{"id":40132,"date":"2015-02-23T02:34:06","date_gmt":"2015-02-23T07:34:06","guid":{"rendered":"http:\/\/www.templatemonster.com\/help\/?p=40132"},"modified":"2017-08-24T06:08:22","modified_gmt":"2017-08-24T10:08:22","slug":"magento-how-to-add-google-analytics-code","status":"publish","type":"post","link":"https:\/\/www.templatemonster.com\/help\/magento-how-to-add-google-analytics-code.html","title":{"rendered":"Magento. How to add Google Analytics code"},"content":{"rendered":"<p><\/p>\r\n<p>This tutorial shows how to add Google Analytics code in Magento.<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=2wFNhbikAxA?width=1280&amp;height=720\" rel=\"prettyPhoto\">Magento. How to add Google Analytics code<\/a><\/p>\r\n<p>In order to add the Google Analytics code, you should perform the following:<\/p>\r\n<ol>\r\n<li>\r\n<p>The first step is locating your <strong>account ID in Google<\/strong>. You will first need to access your tracking code from within your Google Analytics account following this <a href=\"https:\/\/support.google.com\/analytics\/answer\/1008080?hl=en\" target=\"_blank\">detailed tutorial.<\/a>\r\n  <\/p>\r\n<\/li>\r\n<li>\r\n<p>You should get the code <strong>similar to the code below:<\/strong><\/p>\r\n<pre>\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n var _gaq = _gaq || [];\r\n  _gaq.push(['_setAccount', 'UA-XXXXX-X']);\r\n  _gaq.push(['_trackPageview']);\r\n\r\n  (function() {\r\n    var ga = document.createElement('script'); ga.type = 'text\/javascript'; ga.async = true;\r\n    ga.src = ('https:' == document.location.protocol ? 'https:\/\/ssl' : 'http:\/\/www') + '.google-analytics.com\/ga.js';\r\n    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r\n  })();\r\n&lt;\/script&gt;\r\n<\/pre>\r\n<\/li>\r\n<li>\r\n<p><strong>&#8216;UA-XXXXX-X&#8217;<\/strong> in your code ( where XXXXX-X stands for your Account ID number) is your Google <strong>Account ID.<\/strong><\/p>\r\n<\/li>\r\n<li>\r\n<p>Log into your <strong>Magento Admin Area<\/strong> and navigate to <strong>System -> Configuration -> Google API<\/strong>: <\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code1.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code1-300x156.jpg\" alt=\"Magento. How to add Google Analytics code1\" width=\"300\" height=\"156\" class=\"aligncenter size-medium wp-image-40134\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code1-300x156.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code1-150x78.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code1-1024x533.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code1.jpg 1224w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<li>\r\n<p>Expand the <strong>&#8216;Google Analytics&#8217;<\/strong> row, <strong>enable<\/strong> Google Analytics and insert your <strong>Account ID<\/strong> into the box.<\/p>\r\n<\/li>\r\n<li>\r\n<p>Click <strong>&#8216;Save Config&#8217;<\/strong> button at the top right to save the changes:<\/p>\r\n<p><a href=\"\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code2.jpg\"><img loading=\"lazy\" src=\"\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code2-300x153.jpg\" alt=\"Magento. How to add Google Analytics code2\" width=\"300\" height=\"153\" class=\"aligncenter size-medium wp-image-40136\" srcset=\"https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code2-300x153.jpg 300w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code2-150x76.jpg 150w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code2-1024x522.jpg 1024w, https:\/\/www.templatemonster.com\/help\/wp-content\/uploads\/2014\/11\/Magento.-How-to-add-Google-Analytics-code2.jpg 1212w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a>\r\n<\/li>\r\n<\/ol>\r\n<div class=\"inline-banner\">\r\n<a href=\"https:\/\/www.templatemonster.com\/service-center\/\">\r\n<img src=\"\/help\/files\/banners\/inline\/Banner-2-(835-x100).jpg\"\/>\r\n<\/a>\r\n<\/div>\r\n<p>Feel free to check the detailed video tutorial below:<\/p>\r\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=2wFNhbikAxA?width=1280&amp;height=720\" rel=\"prettyPhoto\">Magento. How to add Google Analytics code<\/a><br \/>\r\n<\/p>","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to add Google Analytics code in Magento.<\/p>\n","protected":false},"author":62,"featured_media":43890,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[729],"tags":[1043,929,2407],"_links":{"self":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/40132"}],"collection":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/users\/62"}],"replies":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/comments?post=40132"}],"version-history":[{"count":2,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/40132\/revisions"}],"predecessor-version":[{"id":83013,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/posts\/40132\/revisions\/83013"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media\/43890"}],"wp:attachment":[{"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/media?parent=40132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/categories?post=40132"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.templatemonster.com\/help\/wp-json\/wp\/v2\/tags?post=40132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}