How to add google analytics to your osCommerce store
multimixer | learn | Monday June 6 2011I 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.
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
You 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 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
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
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.
Just 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
Great, Just what I was looking for – Thanks!
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?
Thanks, you saved a lot of time of mine.
@Zack
For this you need to modify file catalog/includes/modules/header_tags/ht_google_analytics.php