Skip to content
OpenCart · User manual

Google Marketing Tools

Version 13.25.0 Product page
Chapter 7

Google Tag Manager

How to import the generated workspace file into your Google Tag Manager container, publish it and check with preview mode that every tag fires.

What you receive

After you press Generate and send workspace, you receive an email with a file attached. Its name ends in .json. It is a Google Tag Manager container export that already contains:

  • the tags you enabled, with your IDs in place;
  • the triggers that fire them on the shop events;
  • the variables that read product, cart, customer and order data from the shop.

Tags you did not enable are not in the file. Save the attachment on your computer without opening or editing it.

Importing the file

  1. Sign in to Google Tag Manager and open the container whose ID you typed in the extension.
  2. Open Admin and, in the container column, choose Import Container.
  3. Press Choose container file and select the .json file.
  4. Under Choose workspace, select Existing and pick your default workspace, or select New to import into a separate workspace.
  5. Choose an import option:
    • Overwrite replaces everything in the workspace with the content of the file. Use it for a container that only holds Google Marketing Tools tags. It gives the cleanest result when you regenerate after disabling tags, because the removed tags disappear.
    • Merge keeps what is already in the workspace and adds the content of the file. Use it when the container also holds tags you created yourself. Choose Overwrite conflicting tags, triggers, and variables so the entries of the file replace older versions with the same name.
  6. Review the summary of new, modified and deleted items and press Confirm.

If Google Tag Manager rejects the file, see Troubleshooting.

Publishing

An imported workspace is only a draft. To make it live:

  1. Press Submit at the top right of the workspace.
  2. Give the version a name, for example the date and "Google Marketing Tools".
  3. Press Publish.

From this moment the shop serves the new tags to your visitors, provided the extension is enabled and the GTM Container ID of the General tab is the same container.

Changing your tags later

Do not edit the generated tags by hand in Google Tag Manager: the next import replaces them. Change the values in the GTM Workspace Generator tab, generate a new file, import it and publish again. Your own tags can live in the same container if you give them different names and import with Merge.

Testing with preview mode

Google Tag Manager preview mode (Tag Assistant) shows which tags fire on each page of your shop before or after publishing.

  1. In your container press Preview.
  2. Type the address of your shop and press Connect. Your shop opens in a new window connected to Tag Assistant.
  3. Browse the shop in that window as a customer would. In the Tag Assistant window, the left column lists the events received.
  4. Click an event to see the Tags Fired and Tags Not Fired for it. Open the Data Layer tab to see the data the shop sent.

The shop publishes events with these names. Look for them in the left column:

What you do in the shopEvent in Tag Assistant
Open the home page, a category, a search result or a productHome page, Category, Search, Product
Click a product in a listProduct click
Add to or remove from the cart, add to the wish listAdd to cart, Remove from cart, Add to wish list
Open the cart and start the checkoutCart, Checkout start
Choose shipping and paymentSet shipping, Set payment
Finish an orderPurchase
Register, log in, send the contact formAccount registered, Account logged, Contact form
Accept or change cookiesgoogleConsentUpdate

A complete test places a real test order with a payment method that leaves the order in one of the statuses selected in Conversions: Order status for tracking. On the order confirmation page, check that Purchase appears and that your GA4 and conversion tags are under Tags Fired.

Testing with consent

If the consent popup is enabled, tags that need consent do not send data until you accept the matching category. In Tag Assistant, open an event and its Consent tab to see the state of each consent type. Test at least once accepting everything and once refusing everything.

Checking the data in the shop

The Debug mode of the General tab is a second way to look at the data. While you are logged in to the OpenCart administration, the storefront shows a popup with what was sent to Google Tag Manager. See General settings.

To confirm that a platform received the data, use its own diagnostic screen. The Show help section of each tag in the workspace generator links to its documentation.

Still need help?

Open a support ticket from your account and our team will look at your store with you.