InMotion Hosting Support Center

Google analytics provides in-depth data into who’s visiting your website and what they are doing once they are there. If you have not already set up a Google Analytics account, you’ll need to do so.

  1. Once you have your Google Analytics code log into your OpenCart Dashboard
  2. Go to System > Settings
  3. Choose your store and click “edit
  4. Go to the server tab and scroll to the bottom
  5. Find the Category for Google Analytics Code and paste your code in the text box If you are not familiar how to get your Google Analytics code please see our article on Installing Google Analytics
  6. Click “Save

You’ve now added Google Analytics to your OpenCart Website and Google can start collecting data about your website’s visitors. If you need further assistance please feel free to ask a question on our support center website.

Was this article helpful?
Continued Education in Course OpenCart
You are viewing Section 34: 300: Adding the Google Analytics code to OpenCart 1.5
Section 33: 302: Dealing with Returned Orders in OpenCart 1.5
Section 35: 306: Selling Gift Vouchers on your OpenCart 1.5 Website

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, Click the button below to be taken to the login page.

n/a Points
2016-05-10 10:52 pm

Good way to add code Google Analytics for Opencart from 1x - 2x 


n/a Points
2016-04-22 6:29 am

Thanks for your useful information sharing here.

Appreciable Job..

n/a Points
2016-04-21 3:38 am

I tried pasting the google analytics java script code under extensions>analyticsbut I am getting the following errorUndefined index: store_id in /customers/7/a/1/(mydomainname).com/httpd.www/admin/controller/analytics/google_analytics.php on line 13Warning: Cannot modify header information - headers already sent by (output started at /customers/7/a/1/(mydomainname).com/httpd.www/admin/controller/startup/error.php:34) in /customers/7/a/1/(mydomainname).com/httpd.www/system/library/response.php on line 12What does this mean and how do I rectify this? Please help

10,724 Points
2016-04-21 8:54 am
It's possible you placed the code in a spot that disrupted the PHP code. The error you are seeing is a PHP error.
n/a Points
2015-04-12 11:07 am

Hi buddies,

This is a very simple and easy way to add the google analytics code to opencart and i just did it all like discribed, however when i was thinking that it was simple and fast google comes with "Status: Tracking Not Installed

Last checked: Apr 12, 2015 7:07:37 AM PDT
The Google Analytics tracking code has not been detected on your website's home page. For Analytics to function, you or your web administrator must add the code to each page of your website."
What can be wrong and what to do?
Thanks in advance,
43,761 Points
2015-04-13 1:18 pm
Hello Vitor,

This seems to be an issue with OpenCart. Arnel mentioned above that there is a thread with a solution for this. Try that and see if that helps. He also provided a link to a plugin that may also help.

Kindest Regards,
Scott M
n/a Points
2015-03-17 10:17 pm

Hi Arnel

I realised my mistake?!! I just pasted the tracking id not the whole code! no wonder it wasnt picking up. It should work now.


Thanks for your feedback as well. appreciated




n/a Points
2015-03-04 8:02 am

I am using OC1.5.6 and I have inserted my GA code in the server tab section, unfortunately Google tells me there is a missing tracking code -> No valid tracking code found for property.

42,232 Points
2015-03-04 12:12 pm
Hello Pal,

Sorry for the problems with the Google Analytics. Apparently, the problem has also been seen by other OpenCart users. They posted a solution here. There is also a plugin that could make this easier as well. The plugin can be found here.

Arnel C.
n/a Points
2015-02-04 8:51 pm

Hi There,

So pasting the google analytics code into the text box will apply google analytics to the entire website? 


On the Google analytics page it says "This is your tracking code. Copy and paste it into the code of every page you want to track."

31,313 Points
2015-02-05 12:34 pm
Hello Alex,

Thank you for your comment. For many Content Managment Systems (CMS), you will just have to add the Google code to the Dashboard, or use a plugin. It will then add the code to the pages.

Since OpenCart is built in PHP (like many CMS's), most of the pages are created dynamically. Meaning they are generated as needed, and there is no "static" page to add a tracking code to.

If you have any further questions, feel free to post them below.

Thank you,
n/a Points
2014-10-26 2:48 pm

Thanks a million.

n/a Points
2014-09-03 5:15 pm


Why cant I install Google Analytics in my site.It keeps on diverting me to error pagethat says:


You don't have permission to access /admin/index.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request

42,232 Points
2014-09-03 5:54 pm
Hello Laarnibebe,

Sorry to hear that you are having a problem with the Google Analytics installation. Usually, when you see an error of this nature it means that the directory (or folder) mentioned in the error has a permission setting that does not allow you to make that change. This could also be a server security rule. You will need to check permissions for that folder and/or consult with your server support team in order to determine why you cannot install the module.
n/a Points
2014-08-04 8:40 pm
No improvement needed. This was the best, most straight-forward instruction and I was able to do it minutes. Thank you so much!!
n/a Points
2014-07-22 1:26 pm

I'm really new to building an online store and articles like these are so useful for a rookie like myself! I created a Google Analytics account and had no clue what to do after that (lol) so I searched for "where to add google analytics code in opencart" and this brilliant article was the 1st hit which I followed. I'm in the final stages of completing my website, and articles like these save me so much time which I can use to finalise my website instead of figuring out "code".

Thank you.

n/a Points
2014-07-22 1:25 pm
You do not need to improve this article. It is brilliant and extremely useful. Thank you.

Post a Comment

Email Address:
Phone Number:

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

17 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!