3

I recently updated from Magento 1.6.2 to 1.9.2.1 and I noticed that Google Analytics stopped tracking the website since I updated.

enter image description here

I don't have a googleanalytics folder in my template, nor do I have googleanalytics.xml in my layout folder. I never had that either, so I don't think it should be necessary for my Google Analytics to work, right?

I looked in to tutorials like this one: https://www.siteground.com/tutorials/magento/magento_google_analytics.htm and I noticed that the Google API module in that picture has a lot more options than I have in mine, so maybe I should update the module? enter image description here

1
  • One of the most recent version of Magento included a move to Google's Universal Analytics. I suggest making sure that your GA account is setup for that.
    – Tyler V.
    Aug 20, 2015 at 7:39

2 Answers 2

1

I changed the Type to Universal Analytics and added the analytics code to my head.phtml based on the answer of this topic How do I add universal analytics to my magento store? and it started working again!

1

Go to following file

 app/design/frontend/<your_theme_package>/default/layout/googleanalytics.xml

Change following

<default>
        <!-- Mage_GoogleAnalytics -->
        <reference name="after_body_start">
            <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" />
        </reference>
 </default>

to

<default>
     <!-- Mage_GoogleAnalytics -->
     <reference name="before_body_end">
        <block type="googleanalytics/ga" name="google_analytics" as="google_analytics" template="googleanalytics/ga.phtml" />
     </reference>
</default>

and move googleanalytics/ga.phtml file from base theme to your theme. Now you should be able to see the Google analytics code in website webpage view source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.