4

How to add google analytics to your osCommerce store

multimixer | learn | Monday June 6 2011

I just saw an other forum post in the osCommerce forum, asking how to add google analytics to a osCommerce store. Adding google analytics to your osCommerce store became in version 2.3.1 a very easy process: There are no files to edit or any code to add to anywhere. All you have to do is to install the module in your administration panel.

Let’s take things from the beginning and step by step, there are actually just to steps to do

1 Get your code from google

First please go to the google analytics website. In case you don’t have a google analytics account, you will need to create one, if you have, just login.

Login to the google analytics website or create a new account

Second step is to create an account and a profile for the website you want to start tracking, your store in this case. The instructions about how to do that are very detailed on the google website, so there is no reason to repeat this here. The screen you will face will look like this

Create a new account for your websiteYou could also create just a new “profile” in case your store is just a pert of your complete website, this depends on how you want your data to be grouped and displayed

Important to start tracking your store is to get the unique tracking number, that looks like this

The google analytics tracking numberThe number we need is the one that start with UA- in the image above. Please do not use the number on the image here, you will get your own number from google. In case you want to add “ecommerce tracking”, press on edit on the right hand side of your profile line and enable it from there

adding ecommerce tracking

2 Install the google analytics module

Now, after we have the google analytics number, lets add it to our osCommerce store. We need to login to the administration panel and then click on modules>header tags and install on the top right corner. They may be several modules available for installation, the one we need is called, how else, “google analytics”. Install it

install the google analytics module in the osCommerce administration panel

Last step is to add the google number to the module and to enable ecommerce tracking in case we have it enabled at google too.

Add google analytics to your oscommerce storeJust type in the number, that’s it. As for the “Javascript Placement” I personally prefer to add it to the footer, it makes no difference to the tracking results

Enjoy

Click +1 to recommend this to your friends when they search.

multimixer

follow multimixer on Twitter

Follow me on twitter. I'm not tweeting all day long and guaranteed no spam and no advertising.

If you like what you read and if you think it will help you in your online business, then please consider a donation.

There is no obligation to do so and all information provided here is free to use.

It will however help to keep this blog alive, free of advertising and full of content.

  • Steve 30/01/2012 at 19:50

    Great, Just what I was looking for – Thanks!

  • Zack 30/01/2013 at 10:50

    This is fine and dandy if you want to use the default code but how can one go about modifying the code with filters and such?

  • Fernando 15/02/2013 at 12:52

    Thanks, you saved a lot of time of mine.

  • multimixer 21/02/2013 at 15:38

    @Zack

    For this you need to modify file catalog/includes/modules/header_tags/ht_google_analytics.php