Categories

Featured templates

Magento. How to add Google Analytics code

Mary Gilmore February 23, 2015
Rating: 5.0/5. From 1 vote.
Please wait...

This tutorial shows how to add Google Analytics code in Magento.

Magento. How to add Google Analytics code

In order to add the Google Analytics code, you should perform the following:

  1. The first step is locating your account ID in Google. You will first need to access your tracking code from within your Google Analytics account following this detailed tutorial.

  2. You should get the code similar to the code below:

    <script type="text/javascript">
     var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-XXXXX-X']);
      _gaq.push(['_trackPageview']);
    
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })();
    </script>
    
  3. ‘UA-XXXXX-X’ in your code ( where XXXXX-X stands for your Account ID number) is your Google Account ID.

  4. Log into your Magento Admin Area and navigate to System -> Configuration -> Google API:

    Magento. How to add Google Analytics code1

  5. Expand the Google Analytics row, enable Google Analytics and insert your Account ID into the box.

  6. Click ‘Save Config’ button at the top right to save the changes:

    Magento. How to add Google Analytics code2

Feel free to check the detailed video tutorial below:

Magento. How to add Google Analytics code

Themes for Magento
This entry was posted in Magento Tutorials and tagged analytics, google, Magento. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket