InMotion Hosting Support Center

Without analytics code osCommerceYou can track your osCommerce website statistics with Google analytics. osCommerce has a built in function that allows you to add Google Analytics code to your site. The image to the right shows what the code looks like before adding the Google Analytics code. Below are the steps to add your Google Analytics to your osCommerce website.

Note! You can get your Google Analytics code for free. Please see our article on Creating a Google Analytics Account.

Steps to add Google Analytics code

  1. Log into your osCommerce Admin dashboard.
  2. Go to the Header Tags osCommerceGo to Modules > Header Tags.
  3. Click Google analytics module osCommerceClick Google Analytics from the Modules list.
  4. Edit the module osCommerceClick the Edit button on the right hand side.
  5. Add code to the module osCommerceAdd the Google Analytics ID in the Google Analytics ID box.

    If you do not know how to get your ID you can get it from the code at Google. Your Google Analytics code should look similar to the code below. The XXXXX-Y indicates the property ID. osCommerce will need the whole ID like UA-XXXXX-Y.

    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-XXXXX-Y']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);

    Save the Changes.

    Google Analytics code in head section osCommerceosCommerce will create the Google Analytics code for you. Once you save the changes you will see the code in your head section like the snapshot to the right.

Was this article helpful?
Continued Education in Course osCommerce
You are viewing Section 3: 301: Adding Google Analytics to osCommerce
Section 2: Viewing the Best Viewed Report in osCommerce
Section 4: Administrator View of Sales Order in osCommerce

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Support Center Login

Our Login page has moved. Please click the button below to be redirected to the login page.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!