Knowledge Base

Add Google Analytics to your site

Google Analytics is a very good and popular tool which allows you to collect basic visitor data from your site.

If you are not familiar with it you can read the getting started page. We are interested in web tracking and we’ll be adding the code directly to the site.

Get the tracking code by following the instructions above, it should look something like this

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXXXXX-Y', 'auto');
ga('send', 'pageview');
</script>

For modern themes we suggest you grab the child theme from our downloads section (or create one if you are not using one of our themes), then copy over the theme’s header.php file to the child and paste the entirety of the code just before the closing </head> tag. Alternatively you can use a plugin like the Insert Headers & Footers one to do that without file editing.

Older themes with CSSIgniter Settings panel

Navigate to CSSIgniter Settings > Google Options and paste the code in the Google Analytics box, then click the Save changes button above.

analytics

Use the coupon code WORDPRESS and save 30% OFF! Buy Now