Magento Google Analytics Code is not showing

I am new to magento and I have placed my account number in my system > Configuration > Sales > Google API. I have also enabled Google Analytics. But still I can't see the Google Analytics code on any of my magento application. What I have double checked are:

  1. Account Number are proper (These are for the same domain name for which we are trying).
  2. Google Analytics is Enabled (Yes).

-------------Problems Reply------------

Same here. It turns out that the problem was caused by my customized theme that was developed for magento 1.5 and now is applied to 1.7.

In app/design/frontend/mytheme/layout/googleanalytics.xml i had:

<block type="googleanalytics/ga" name="google_analytics" as="google_analytics" />

And it should be:

<block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />

Have just checked and the google analytics code is normally placed in the after_body_start block.
If that block isn't used in your theme or if you just want to follow better practices change that to before_body_end. You can find the file "googleanalytics.xml" in your theme's layout directory or in app/design/frontend/base/default/layout.

Category:magento Views:0 Time:2010-11-12

Related post

  • Google Analytics code: can it go before in the document? 2009-11-10

    Google recommends to put the analytics code just before the <body> tag. I'm trying to integrate ecommerce in my site and it'd be easier to call pageTracker._addTrans from other places than the footer. Will it be ok if I change ... <script ty

  • google analytics code is not recording the traffic? 2010-02-09

    One of my client's site's google analytics code is not working. What is the problem in this code? <script type='text/javascript'> var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; :

  • Put Google Analytics code on a link? 2010-04-29

    How do you put google analytics code on a link, for example a link on your page to a download file. Is there a way to call the analytics function from a link? Cheers. --------------Solutions------------- You can track the click of the link using the

  • New Google Analytics code into external file 2010-10-06

    New Google Analytics code looks like one below: <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-0000000-00']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type

  • Where to place Google Analytics code in ASP.NET web application 2010-10-19

    I want to find a place to put my Google Analytics code in my ASP.NET web application. I would like to place it somewhere once and not have to copy and paste the code into multiple files. Is there somewhere that I could inject it that I would only hav

  • where to put google analytics code 2011-04-11

    Possible Duplicate: google analytics at head? or end of body? The google analytics code has to be put before the HEAD tag. Can anyone tell where do i put the ga code if there is no HEAD tag present in my jsp file? --------------Solutions-------------

  • Best place to insert the google analytics Code 2011-07-26

    This question already has an answer here: Should I put the Google Analytics JS in the <head> or at the end of <body>? 3 answers Where's the best place to insert the google analytics code in wordpress? header or footer? I prefer footer bec

  • PHP variable inside Google Analytics Code 2011-10-15

    I have the following code if ($form_id == 1) { $form_name = "Test form 1"; } elseif ($form_id == 2) { $form_name = "General Enquiries"; } else { // do something } I now need to echo $form_name within this bit of code but cant seem to be able to get i

  • Can any expert explain this google analytics code briefly? 2012-01-30

    I need help to understand this google analytics code: <script type="text/javascript"> var clogin=""; var cloginf; var usertype = "Shopper"; clogin = get_cookie('custnameIn'); if (clogin != null) { usertype = "Site-Mem"; cloginf = get_cookie('cu

  • create google analytics code through API 2012-04-08

    Is there a google API to create google analytics code through API(not going to google site manually and create) ? Please help... --------------Solutions------------- The GA Management API is read-only. You cannot create accounts or profiles through i

  • Embed Google Analytics Code into Excel Spreadsheet 2012-07-27

    Hi, I am interested in embedding the google analytics code into an excel spreadsheet that I update each night and publish it online. I understand that I could go to a text editor after I upload it and add the code, but I update the sheet every night

  • Position of Google Analytics code 2009-07-01

    The Google Analytics setup instructions state: This tracking code snippet should be included in your site's pages so that it appears at the bottom of the page's HTML (or generated-HTML) structure, before the closing <body> tag. Does their code

  • Is it possible to put Google Analytics code in an external JS file? 2009-07-15

    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._g

  • Dynamically serve up Google Analytics code with PHP 2009-09-01

    In trying to improve our Google Analytics data for our website, I created a piece of PHP code that would determine the server that the website is being served from, and only serve up the GA code when being run from our Production server. The code is

  • Auto Add Google Analytics Code to a HTML page each time the page is rendered 2010-09-21

    I have a web site hosted on an Apache web server. Another person uploads static HTML files to a folder each week via FTP generated from third party software. I am looking to insert Goggle Analytics code on each page when it is rendered while preservi

  • What is the recommended way to add Google Analytics code and why? 2011-01-08

    I've read in many sources that Google's recommended way to add GA code (link) can slow down page loading. StackOverflow itself does not place it at the header (as Google recommends) but at the bottom of the page. So should I go with Google, StackOver

  • Can I track 2 sub-domains with same Google Analytics code for mobiles (i.e. ga.php) 2011-04-13

    Let say I have first.mydomain.com and second.mydomain.com, what if I install same GA code to each of those different domains. Is this possible? if so how Google Analytics will show these both for a single profile? --------------Solutions-------------

  • Non-minified Google Analytics code 2011-04-28

    I am building a Blackberry application using Phonegap, and would like to use Google Analytics to track some usage in it. Thanks to dodgy Blackberry browsers, XHR doesn't really work. There is a replacement in Phonegap that does work fine, but I need

  • I have google analytics code in my wordpress site and google says it can read the data but no data is being passed , 2011-06-07

    I was using a plug-in called analyticator and also had the code pasted in by accident so i took out the extra code and now i still have no data for analytics. If someone could intervene and provide some insight I would appreciate it. My website is at

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.186 (s). 11 q(s)