First, start off with signing up for a trial by contacting us at [email protected], and you will get access to our Lab. You will be provided with a JAVASCRIPT_KEY
from us.
Integrating LiftIgniter beacon to your website
All you have to do is add the following code snippet (the beacon
) to the head
of your HTML webpage. It could also be found at ONBOARD
of our Lab along with your key.
<script type="text/javascript">
if (typeof $igniter_var === 'undefined') {
// Ensures that our client code is updated.
(function(w,d,s,p,v,e,r) {w.$ps = (w.performance && w.performance.now && typeof(w.performance.now) == "function") ? w.performance.now() : undefined;w['$igniter_var']=v;w[v]=w[v]||function(){(w[v].q=w[v].q||[]).push(
arguments)};w[v].l=1*new Date();e=d.createElement(s),r=d.getElementsByTagName(s)[0];e.async=1;
e.src=p+'?ts='+(+new Date()/3600000|0);
r.parentNode.insertBefore(e,r)})(window,document,'script','//cdn.petametrics.com/{JAVASCRIPT_KEY}.js','$p');
// Don't forget to REPLACE JAVASCRIPT_KEY for cdn url.
$p("init", {JAVASCRIPT_KEY}); // REPLACE JAVASCRIPT_KEY
$p("send", "pageview");
}
</script>
After this script runs, you can fully access our SDK with the format $p(FUNCTION, ARGUMENTS)
from your Javascript. Checkout the SDK/API Documentations for further details on the SDK.
Notes
If you are using a tool such as Google Tag Manager, you can insert the
beacon
there.Ideally, you should install this
beacon
on all pages on your website. However, if for privacy reasons there are pages that you would not like LiftIgniter to track, keep in mind that thebeacon
needs to be on:
- any page where you wish to show LiftIgniter recommendations
- any page that LiftIgniter might recommend from your website
Check the integration
When a page with
beacon
becomes active, it will start sending pageview activities to us. Go to our Lab. You should see pageview numbers rising.
Read our Console Debugging section for a deeper dive
For a deeper dive on the events that are being sent and how to understand what's happening, see the Console Debugging and Beacon Check sections of the documentation.