slscart logo

Adding Google analytics to slscart

After Google analytics code is added, check in the Google analytics account to make sure it is communicating with the store.

Automatically

Starting in slscart 10.4.1 it is much easier to enable Google Analytics for the store.

1. Add the site code %STYLE_LOWER% to the template, just before </body>

2. Add the Google Analytics ID in store admin under Administration > Site Settings

Manually

Adding Google analytics to slscart is very easy. It involves adding some code to the template.

Add the following code just before </body> in your template.

<script>
window.ga=function(){ga.q.push(arguments)};ga.q=[];ga.l=+new Date;
ga('create','UA-XXXXX-Y','auto');ga('send','pageview')
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>

Change UA-XXXXX-Y to your site's Google analytics ID.

***