{"_id":"57d8a88eda17c30e00389708","githubsync":"","parentDoc":null,"user":"5668fa9755e4b32100935d41","project":"5668fab608f90021008e882f","__v":1,"version":{"_id":"5668fab608f90021008e8832","__v":19,"project":"5668fab608f90021008e882f","createdAt":"2015-12-10T04:08:22.769Z","releaseDate":"2015-12-10T04:08:22.769Z","categories":["5668fab708f90021008e8833","569740f124490c3700170a64","569742b58560a60d00e2c25d","569742bd0b09a41900b2446c","569742cd69393517000c82b3","569742f459a6692d003fad8f","569743020b09a41900b2446d","5697430b69393517000c82b5","56a17776470ae00d00c30642","56a2c48a831e2a0d0069b1ad","56b535757bccae0d00e9a1cd","56e1ff6aa49fdc0e005746b5","57e1c88115bf6522002a5e4e","57fa65275ba65a17008b988f","57fbeea34002550e004c032e","58474584889b6c2d00fb86e9","58475dcc64157f0f002f1907","587e7b5158666c2700965d4e","58a349fc30852819007ba083"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.18.0","version":"1.18"},"category":{"_id":"569742b58560a60d00e2c25d","__v":2,"pages":["5697436959a6692d003fad90","5697445759a6692d003fad92"],"project":"5668fab608f90021008e882f","version":"5668fab608f90021008e8832","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-14T06:39:49.331Z","from_sync":false,"order":4,"slug":"javascript-integration-guide","title":"Javascript SDK Integration Guide"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-14T01:31:58.482Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"First, start off with signing up for a trial by contacting us at [info:::at:::liftigniter.com](mailto:info@liftigniter.com), and you will get access to our [Lab](https://lab.liftigniter.com/). You will be provided with a `JAVASCRIPT_KEY` from us.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Integrating LiftIgniter beacon to your website\"\n}\n[/block]\nAll 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](https://lab.liftigniter.com/) along with your key. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script type=\\\"text/javascript\\\">\\nif (typeof $igniter_var === 'undefined') {\\n// Ensures that our client code is updated.\\n(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(\\narguments)};w[v].l=1*new Date();e=d.createElement(s),r=d.getElementsByTagName(s)[0];e.async=1;\\ne.src=p+'?ts='+(+new Date()/3600000|0);\\nr.parentNode.insertBefore(e,r)})(window,document,'script','//cdn.petametrics.com/{JAVASCRIPT_KEY}.js','$p');\\n// Don't forget to REPLACE JAVASCRIPT_KEY for cdn url.\\n\\n$p(\\\"init\\\", {JAVASCRIPT_KEY}); // REPLACE JAVASCRIPT_KEY\\n$p(\\\"send\\\", \\\"pageview\\\");\\n}\\n</script>\",\n      \"language\": \"javascript\",\n      \"name\": \"beacon\"\n    }\n  ]\n}\n[/block]\nAfter 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.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Notes\",\n  \"body\": \"If you are using a tool such as Google Tag Manager, you can insert the `beacon` there.\\n\\nIdeally, 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 the `beacon` needs to be on:<ul>\\n<li>any page where you wish to show LiftIgniter recommendations</li>\\n<li>any page that LiftIgniter might recommend from your website</li>\\n</ul>\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Check the integration\",\n  \"body\": \"When a page with `beacon` becomes active, it will start sending pageview activities to us. Go to our [Lab](http://lab.liftigniter.com/). You should see pageview numbers rising.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Read our Console Debugging section for a deeper dive\",\n  \"body\": \"For a deeper dive on the events that are being sent and how to understand what's happening, see the [Console Debugging](doc:console-debugging) and [Beacon Check](doc:beacon-check) sections of the documentation.\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/6a7313a-li-lab-pageviews-rising.gif\",\n        \"li-lab-pageviews-rising.gif\",\n        1427,\n        734,\n        \"#e1e7e7\"\n      ],\n      \"caption\": \"Visiting pages on www.liftigniter.com and checking how pageview numbers rise in the Lab.\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"integrating-liftigniter","type":"basic","title":"Integrating LiftIgniter"}

Integrating LiftIgniter


First, start off with signing up for a trial by contacting us at [info@liftigniter.com](mailto:info@liftigniter.com), and you will get access to our [Lab](https://lab.liftigniter.com/). You will be provided with a `JAVASCRIPT_KEY` from us. [block:api-header] { "type": "basic", "title": "Integrating LiftIgniter beacon to your website" } [/block] 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](https://lab.liftigniter.com/) along with your key. [block:code] { "codes": [ { "code": "<script type=\"text/javascript\">\nif (typeof $igniter_var === 'undefined') {\n// Ensures that our client code is updated.\n(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(\narguments)};w[v].l=1*new Date();e=d.createElement(s),r=d.getElementsByTagName(s)[0];e.async=1;\ne.src=p+'?ts='+(+new Date()/3600000|0);\nr.parentNode.insertBefore(e,r)})(window,document,'script','//cdn.petametrics.com/{JAVASCRIPT_KEY}.js','$p');\n// Don't forget to REPLACE JAVASCRIPT_KEY for cdn url.\n\n$p(\"init\", {JAVASCRIPT_KEY}); // REPLACE JAVASCRIPT_KEY\n$p(\"send\", \"pageview\");\n}\n</script>", "language": "javascript", "name": "beacon" } ] } [/block] 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. [block:callout] { "type": "info", "title": "Notes", "body": "If you are using a tool such as Google Tag Manager, you can insert the `beacon` there.\n\nIdeally, 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 the `beacon` needs to be on:<ul>\n<li>any page where you wish to show LiftIgniter recommendations</li>\n<li>any page that LiftIgniter might recommend from your website</li>\n</ul>" } [/block] [block:callout] { "type": "success", "title": "Check the integration", "body": "When a page with `beacon` becomes active, it will start sending pageview activities to us. Go to our [Lab](http://lab.liftigniter.com/). You should see pageview numbers rising." } [/block] [block:callout] { "type": "info", "title": "Read our Console Debugging section for a deeper dive", "body": "For a deeper dive on the events that are being sent and how to understand what's happening, see the [Console Debugging](doc:console-debugging) and [Beacon Check](doc:beacon-check) sections of the documentation." } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/6a7313a-li-lab-pageviews-rising.gif", "li-lab-pageviews-rising.gif", 1427, 734, "#e1e7e7" ], "caption": "Visiting pages on www.liftigniter.com and checking how pageview numbers rise in the Lab." } ] } [/block]