Skip to content
  1. Docs
  2. Service
  3. Analytics and E-commerce

Analytics and E-commerce

How to connect Google Analytics, Google Tag Manager, Google Ads and site verification in the Trust theme for OpenCart 3, enable E-commerce and set up click tracking (goals).

3 min read

The Analytics&E-commerce module connects Google counters to the site without editing the theme: Google Analytics, Google Tag Manager, Google Ads and site verification for Search Console. Separately it enables E-commerce (purchase data) and lets you set up goals — tracking of clicks on site buttons.

It is an extension of the "Analytics" type. Open Extensions → Extensions, choose the "Analytics" type, find "OCTemplates - Analytics&E-commerce", install it if needed and click "Edit".

General

The "General" tab has only the "Status" switch. A disabled module outputs no code on the site. The counters are inserted into pages before the closing </body> tag.

Google Analytics

Google Analytics tab: IDs and E-commerce

On the "Google Analytics" tab turn "Status" on — the fields appear:

FieldWhat to paste
Account IDThe Google Analytics data stream ID, for example G-XXXXXXXXXX. You can see it in your Google Analytics account after creating a property.
GTM account IDThe Google Tag Manager container ID, for example GTM-XXXXXXX.
ADS account IDThe Google Ads account ID, for example AW-XXXXXXXXX-X.
google-site-verification meta tagOnly the value of the content attribute of the meta tag Google gives you to confirm site ownership (Search Console).

Fill in only the services you use. Each field has a hint and a link to the corresponding Google service.

  • Turn on Google E-commerce — sends product and purchase data to Google Analytics so reports show revenue, popular products and the order funnel.

Tip. Don't connect the same counter twice: if Analytics is set up inside Google Tag Manager, leave the "Account ID" field empty, otherwise views will be counted twice.

Goals

The "Target Settings" tab appears when Google Analytics is enabled. Goals track clicks on site elements and send them to Google Analytics as events.

Goals table: attribute, category, action

ColumnDescription
AttributeA CSS selector of the element whose clicks are tracked: a class, an ID or several selectors separated by commas, for example .button-cart, #button-cart.
CategoryThe event category in Google Analytics, for example shop.
ActionThe action name, for example AddProduct, CallBack, OneClick, Checkout.
Google AnalyticsWhether to send this event to Google Analytics: "Enabled" or "Disabled".

The "+" button at the bottom adds a row, the red button at the end of a row removes it. After changes click "Save".

Examples from the table: the "Buy" button (AddProduct), a callback request (CallBack), "Buy in 1 click" (OneClick) and the move to checkout (Checkout).

Warning. The selector must match your theme's elements. After a theme update or a markup change, check the goals and fix the attributes if needed.

How to check it works

  1. Save the settings

    Turn on the services you need, paste the IDs and save.

  2. Open the site

    In Google Analytics reports ("Realtime" mode) your visit should appear. For Tag Manager use the preview mode.

  3. Check the goals

    Click a tracked element, for example "Buy". In realtime an event with your category and action will appear.

For informing visitors about cookies see "Cookie Policy".