2

Magento 1.9.1 Google Analytics setting up correctly.

I want to add a new google analytics code that have e-commerce transaction (so add the tracking code in all page is not sufficient).

Is it possibile? And if yes, how can I do that?

Thanks a lot for your support!

1

he Quick Way:

Just download our free Magento extension and install. Input your Google Account Number and you're done.

Download Google Universal Analytics for Magento

The Manual Way:

Want to replace your current Google Analytics with its new Universal Analytics? Check out how to below. But first, for those who dont know what it is, here is what the change means:

Why Upgrade to Google Analytics?

After years of fine tuning, they decided to change the way their Analytics tracking works. This radical change requires you to add to the old Google Analytics code if you want to use the new features of Universal Analytics. So what does Universal Analytics add? There are two most applicable changes. Multi-platform tracking. Using the Measurement Protocol and the added collection methods, you can collect the data relating to the device such as the OS, Device type (mobile) etc. Essentially allowing you to track users over multiple devices. The other big feature is the custom dimensions and metrics. This ties into the previous point where it basically expands the ability to recognize more variables that are not currently possible.

How To Upgrade to Universal Analytics

Magento's Google API for Analytics currently does not support Universal Analytics. But that doesn't mean we need to replace it or disable it. The suggested method is to create a new profile in Google Analytics and use the Universal Analytics tracking code. If you add this beside your current Google Analytics tracking code, it will work completely fine. You will see the relative data in each profile.

In this example I decided to just start fresh with Universal Analytics, so I disabled the Google Analytics extension in Magento as seen below

enter image description here

Either way you can add your new Universal Analytics code to your head.phtml file found at app/design/frontend/default/YOURTHEME/template/page/html/head.phtml

enter image description here

  • Hello Ashvin, thanks for your answer but I do not need to upgrade my google analytics. I'm on magento 1.9 so the code was update yet. I want to use 2 code UA at the same time – Giuseppe Morelli Jul 31 '15 at 19:32
  • @Gluseppe Morelli - The following module allows you to have two UA code at the same time scommerce-mage.co.uk/… – stevensagaar Mar 28 '16 at 21:49
0

I find a quick solution: just override (not edit the core file) of the class Mage_GoogleAnalytics_Block_Ga in this way and create a custom variable on magento backend called: google_analytics_code_two

https://gist.github.com/giuseppemorelli/1cbec2a84e980eda6cf3

0

I believe Magento 1.9.1 has added support for Universal Analytics. Simply go to System >> Configuration >> Sales >> Google API >> Type >> Universal Analytics.

  • It is not possibile to use 2 google analytics code at the same time with e-commerce conversion tracking. Basically you can use 2 code, but only one can track e-commerce transaction. – Giuseppe Morelli Nov 9 '15 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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