{"_id":"58793db4deb8cf0f00476829","__v":0,"githubsync":"","parentDoc":null,"category":{"_id":"5697430b69393517000c82b5","version":"5668fab608f90021008e8832","__v":3,"pages":["56975a3d59a6692d003fadae","56a2c3dff4f3410d008a84dc","56d88ca37a04df0b00ddf1c7"],"project":"5668fab608f90021008e882f","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-14T06:41:15.588Z","from_sync":false,"order":10,"slug":"faq-troubleshooting","title":"FAQ / Troubleshooting"},"project":"5668fab608f90021008e882f","user":"5668fa9755e4b32100935d41","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"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-13T20:51:00.604Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":9,"body":"LiftIgniter defaults to using the same protocol as the website. If the website uses HTTP, LiftIgniter will also use HTTP for cdn.petametrics.com, api.petametrics.com, and query.petametrics.com. If the website uses HTTPS, LiftIgniter will also use HTTPS for all three.\n\nIt is possible for you to enhance the security of LiftIgniter use by forcing the use of HTTPS even if your main site does not use HTTP yet. Here is how you would do it.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Loading JavaScript via HTTPS\"\n}\n[/block]\nTo load our JavaScript via HTTPS, you will need to replace the '//cdn.petametrics.com' in the snippet with 'https://cdn.petametrics.com'.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"HTTPS for API and query endpoints\"\n}\n[/block]\nFor each of our endpoints that you want to use as HTTPS, you have to initialize with a config pointing to the HTTPS version of the endpoint.\n\nBelow is a sample JavaScript snippet that forces HTTPS for JavaScript and for all the API and query endpoints.\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script type=\\\"text/javascript\\\">\\n// Ensures that our client code is updated.\\n(function(w,d,s,p,v,e,r) {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','https://cdn.petametrics.com/{JAVASCRIPT_KEY}.js','$p');\\n// Don't forget to REPLACE JAVASCRIPT_KEY for cdn url.\\n\\nvar customConfig = {\\n  config : {\\n    sdk : {\\n      queryServer: \\\"https://query.petametrics.com\\\"\\n    },\\n    activity : {\\n      activityServer: \\\"https://query.petametrics.com\\\"\\n    },\\n    inventory : {\\n      inventoryServer: \\\"https://query.petametrics.com\\\"\\n    }\\n  }\\n}\\n$p(\\\"init\\\", {JAVASCRIPT_KEY}, customConfig); // REPLACE JAVASCRIPT_KEY\\n$p(\\\"send\\\", \\\"pageview\\\");\\n</script>\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Performance implications of HTTPS\"\n}\n[/block]\nUsing HTTPS causes a slight increase in end-user latency due to an increase in the number of round trips. In our experience, switching to HTTPS increases latency by a few hundred milliseconds and increases client timeouts by about 50% (from 0.5% to 0.75% in one time interval we measured). The precise numbers will depend heavily on the geographical location, device type, connection quality, and newness of your users (users will see fewer timeouts later in the same session due to session tokens being cached).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"HTTPS for LiftIgniter Lab\"\n}\n[/block]\nThe LiftIgniter Lab is currently available via both HTTP and HTTPS. Unencrypted HTTP support for the lab will be deprecated soon, so that all connections will be redirected to HTTPS. Until then, we recommend using HTTPS for the Lab by explicitly typing https://lab.liftigniter.com.","excerpt":"","slug":"https-and-security","type":"basic","title":"HTTPS and security"}

HTTPS and security


LiftIgniter defaults to using the same protocol as the website. If the website uses HTTP, LiftIgniter will also use HTTP for cdn.petametrics.com, api.petametrics.com, and query.petametrics.com. If the website uses HTTPS, LiftIgniter will also use HTTPS for all three. It is possible for you to enhance the security of LiftIgniter use by forcing the use of HTTPS even if your main site does not use HTTP yet. Here is how you would do it. [block:api-header] { "type": "basic", "title": "Loading JavaScript via HTTPS" } [/block] To load our JavaScript via HTTPS, you will need to replace the '//cdn.petametrics.com' in the snippet with 'https://cdn.petametrics.com'. [block:api-header] { "type": "basic", "title": "HTTPS for API and query endpoints" } [/block] For each of our endpoints that you want to use as HTTPS, you have to initialize with a config pointing to the HTTPS version of the endpoint. Below is a sample JavaScript snippet that forces HTTPS for JavaScript and for all the API and query endpoints. [block:code] { "codes": [ { "code": "<script type=\"text/javascript\">\n// Ensures that our client code is updated.\n(function(w,d,s,p,v,e,r) {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','https://cdn.petametrics.com/{JAVASCRIPT_KEY}.js','$p');\n// Don't forget to REPLACE JAVASCRIPT_KEY for cdn url.\n\nvar customConfig = {\n config : {\n sdk : {\n queryServer: \"https://query.petametrics.com\"\n },\n activity : {\n activityServer: \"https://query.petametrics.com\"\n },\n inventory : {\n inventoryServer: \"https://query.petametrics.com\"\n }\n }\n}\n$p(\"init\", {JAVASCRIPT_KEY}, customConfig); // REPLACE JAVASCRIPT_KEY\n$p(\"send\", \"pageview\");\n</script>", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "Performance implications of HTTPS" } [/block] Using HTTPS causes a slight increase in end-user latency due to an increase in the number of round trips. In our experience, switching to HTTPS increases latency by a few hundred milliseconds and increases client timeouts by about 50% (from 0.5% to 0.75% in one time interval we measured). The precise numbers will depend heavily on the geographical location, device type, connection quality, and newness of your users (users will see fewer timeouts later in the same session due to session tokens being cached). [block:api-header] { "type": "basic", "title": "HTTPS for LiftIgniter Lab" } [/block] The LiftIgniter Lab is currently available via both HTTP and HTTPS. Unencrypted HTTP support for the lab will be deprecated soon, so that all connections will be redirected to HTTPS. Until then, we recommend using HTTPS for the Lab by explicitly typing https://lab.liftigniter.com.