What is Google Analytics?
Google Analytics is a free tool from Google. It counts your visitors. It shows where they come from and which pages they like. It is like a people counter at a shop door.
To use it, you put a small piece of code on your site. This is called a tracking code.
Get your tracking code
- Go to the Google Analytics website and sign in with your Google account.
- Create an account and a property for your store if you have not yet.
- Open the admin settings and find the data stream or tracking code section.
- Copy the code snippet Google gives you. It is a short block of text starting with
<script>.
Google changes its pages often. If the labels differ, look for words like "tracking code" or "install tag".
Add it to OpenCart (version 3)
- Log in to your OpenCart admin area.
- Click Extensions, then Extensions in the sub-menu.
- In the drop-down called Choose the extension type, pick Analytics.
- Find Google Analytics in the list. If it says not installed, click the green Install (plus) button first.
- Click the blue Edit (pencil) button.
- Paste your tracking code into the Google Analytics Code box.
- Set Status to Enabled.
- Click the blue Save button.
Add it to OpenCart (version 2)
- Click System, then Settings.
- Click Edit next to your store.
- Open the Server tab.
- Paste your code into the Google Analytics Code box.
- Click Save.
Check that it works
- Open your store in a new browser window.
- In Google Analytics, open the real-time report.
- You should see yourself as one active visitor. It can take a few minutes.
Tip: Only paste the code once. If your theme already has the code, you will count each visit twice.
Quick recap
- Google Analytics counts and studies your visitors.
- Copy the tracking code from your Google account.
- In OpenCart 3, use Extensions, then Analytics. In version 2, use System, Settings, Server.
- Paste the code, enable it and save.
- Check the real-time report.