Enabling Google Analytics in Magento: Basics
May 8th, 2009
Magento comes with built-in Google Analytics support, no code-modification necessary. However, the description in the wiki on how to set it up isn’t exactly self-explanatory.
The built-in version comes with some simple conversion tracking that isn’t very accurate. What’s better is to configure funnels in Google Analytics. We’ll go over how to do this in a later post. For now, let’s just deal with the basics.
1. Get an Analytics Account
First you’ll need a Google Analytics Account. Go to http://analytics.google.com and either sign-in with your existing Google ID, or create a new account.
2. Create a Website Profile
Once you’re done creating an account, you’ll land on a page called “Analytics Settings” which is a summary of all your analytics set-ups. Towards the bottom of the page, there is a link which says “Add new website profile”. Click it.
3. Create your domain
Add the URL for your domain in the box provided and select “Finish”.
4. Ignore the mess, copy down the Web Property ID
The next page has a whole bunch of information that we don’t care about. What we need to do is ignore all of this messaging and look for the Web Property ID. It usually starts with “UA-”. We need this number to feed to the Magento admin. Write it down!
5. Go back to the Magento Admin and put it in
Go back to your Magento Admin and go to System->Configuration. Click on “Google API” in the left nav. Open up the blue box that says “Google Analytics”. Uncheck the two boxes that say Enable and Account Number. Set Enable = “yes” and put your “UA-” account number in the box below it.
6. Make sure Google can read the code.
At this point, google analytics is running on your site and starting to collect data. To double-check, you can go back to google analytics and click on the “edit” link for the site profile you just created. On the next screen, click “check status” towards the right top of the screen. Google should swap the status to “Receiving data”. You’re in business!
Coming up next we’ll discuss how to configure this for multi-store set-ups and walk through some advanced funnels.