How to connect Opencart with Google Analytics 4 using Google Tag Manager? Step-by-step guide

network to connect diferents points  in front of laptop with beautifull pictures on screen

If you’re looking for a simple and effective way to connect Google Analytics 4 to your Opencart online store using Google Tag Manager, you’ve come to the right place. In this article, we’ve prepared a step-by-step guide to demonstrate its simplicity. We will walk you through the entire configuration process. Let ‘s get started!

Why Connect Google Analytics 4 with Opencart?

Before delving into the technical details, it’s important to understand why connecting Google Analytics 4 (GA4) to Opencart is essential for your online business. 

GA4 is the latest version of Google’s analytics tool, providing a wide range of valuable metrics and data to comprehend your visitors’ behavior and enhance your marketing strategy. Connecting GA4 with Opencart allows you to track store performance, measure campaign success, and make data-driven decisions

That’s why we have prepared a step-by-step guide to demonstrate how straightforward it is to link your store to GA4. Upon completing the guide, you’ll have a real business analytics example where various events, from adding items to the cart to completing a purchase, are tracked and displayed in the panel as a result of following the steps outlined below.

Step 1: Setting up a Google Analytics 4 Account

creating a Google analytics account
Setting up a new Google Analytics account

The first step is to set up a Google Analytics 4 account. If you already have a GA4 account, you can skip this step. If not, follow these steps:

  1. Access Google Analytics and create a new property for your Opencart’s store.
  2. Enter the necessary information, such as the property name and the URL of your Opencart store.
  3. Accept the terms of service and click on “Create.”

Step 2: Configuring Google Tag Manager for Opencart

Now that you have a GA4 account, it’s time to set up Google Tag Manager (GTM) for your Opencart store. This will allow you to track the actions performed by visitors on your ecommerce site in detail and connect various tracking tools without the need to add additional code to your website. Follow these steps to configure GTM:

  1. Access Google Tag Manager and create a new account.
  2. Provide the required details, such as the account name and the URL of your Opencart store.
  3. Accept the terms of service and click on “Create.”

We create Opencart's extensions that take your online store to the next level.

Stand out from the competition and provide an exceptional shopping experience

Contact us today to revolutionize your  business.

Step 3: Implementing the Google Tag Manager Container in Opencart

Once you have configured GTM, it’s time to implement the container in your Opencart store. Let’s see how to do it.

Install Google Marketing Tools, the top Opencart extension for Tag Manager.

At this point, you may be wondering what Google Marketing Tools is, and the answer is simple—it’s the solution to your problem.

With our Opencart extension, you will achieve seamless synchronization between your store or multi-store and Google Tag Manager. This ensures that all the necessary tags are managed with just one tag (GTM), eliminating tag conflicts and the need to purchase/install a product for each tag you want to install in your store.

Furthermore, with Google Marketing Tools, you can generate XML/CSV feeds of your products for over 20 different external markets, expanding your reach and sales possibilities.

It is also compatible with CRON JOBS, allowing stores with a high volume of products and traffic to automatically generate their feeds based on the schedule configured on their server. This helps prevent performance issues and server limits.

Moreover, Google Marketing Tools is compatible with Google Consent, allowing you to maintain tracking even if users deny cookie acceptance.

Lastly, our extension complies with GDPR regulations and features a synchronization system with Mailchimp for effective abandoned cart campaigns.

Now, let’s show you how to install it.

  1. First, let’s purchase the extension. Visit the official GMT developer website and complete the purchase.
  2. Unzip the main file, ‘Google Marketing Tools,’ which contains individual zip files for each Opencart version range. Yes, as you can see, it is compatible not only with Opencart 4 but also with previous versions.
  3. Once logged into the Opencart administration, go to ‘Extensions > Installer’ and install the zip file that matches your Opencart version.
intalling Google marketing Tools in Opencart
Extension Installer in Opecart
  1. We go to “Extensions > Modifications” to refresh OCMOD changes.
section of Opecart's admin panel from modifications OCMOD
Refresing OCMOD changes in Opencart
  1. Only for Opencart 3 users, if your store is not using this version, you can proceed to the next step. By default, this version comes with a cache system, and we recommend refreshing the cache from the administration dashboard by clicking on a blue button with a gear icon located in the upper right corner.
refresing cache fron Opencart 3 Dashboard
Refreshing cache on Opencart’s Dashboard
  1. As the final step, we go to “Extensions > Modules,” filter by “Modules,” and you will see “Google Marketing Tools” among the top positions. Press the green “Install” button.
install an extension in Opencart
Installing Google Marketing Tools in Opencart

There is an additional step for Opencart versions 1 and 2. We advise you to contact us, and we will gladly guide you through the missing step.

We create Opencart's extensions that take your online store to the next level.

Stand out from the competition and provide an exceptional shopping experience

Contact us today to revolutionize your  business.

Fantastic! Now that we have learned how to install Google Marketing Tools in Opencart, it’s time to take the next step and connect your store to Google Tag Manager.

Generating a workspace for GTM

Before explaining in detail how to generate the workspace, let us explain what it entails.

What is a Google Tag Manager workspace?

It is a working environment within the Google Tag Manager platform where you can create, edit, and manage tags, triggers, and variables.

Each workspace is an independent instance that allows you to make changes to your tracking implementation without directly affecting the production environment of your website. This is especially useful for testing and experimenting before applying changes live.

Within a workspace, you can make changes to your tags, such as adding or modifying event tracking, conversions, or site customization. You can also create and configure triggers, which are the triggers that determine when tags should be fired. In addition, variables allow you to store and reuse dynamic information in your tags and triggers.

For us, the workspace will be a JSON file that contains all the necessary information about the tags you want to use in your store, so you don’t have to do any additional work other than importing it into Google Tag Manager.

Well, let’s generate a workspace. To do this, we will go to the “GTM Workspace Generator” tab, as shown in the image.

generate a workspace for Google tag manager with Google marketing Tools
Generating a Workspace for Google Tag Manager using Google Marketing Tools

Importing the workspace into Google Tag Manager

Once you have generated and downloaded the workspace “.json” file from your email account, it’s time to import it into your Google Tag Manager account. Follow these steps:

Importing the workspace into Google Tag Manager
  1. Download the workspace .json file to your computer.
  2. Log in to your Google Tag Manager account.
  3. Go to the “Admin” tab.
  4. In the list of links on the right, click on “Import Container.”
  5. Press the ‘Choose container file’ button and browse for the file.
  6. Select whether you want to import the workspace into an existing container or a new one.
  7. You have the option to completely replace the workspace (“Overwrite”) or merge all the data (“Merge”). We always recommend “Overwrite” if you haven’t installed your own tags.
  8. Click the blue “Confirm” button.
  9. The system will return you to the main page. Click the blue “Submit” button to publish your changes.
  10. Insert a name and description to identify this version of the workspace, and click the “Publish” button located in the upper right corner.

Now that we have generated and implemented the container in Google Tag Manager, we can take the next step. We are getting closer to our goal: linking your Opencart store to Google Analytics 4 through Google Tag Manager.

Step 4: Activation of Google Marketing Tools

Once we have generated, imported, and published the workspace in our Google Tag Manager account, we can enable Google Marketing Tools. When we enable Google Marketing Tools, the Google Tag Manager code will be inserted, which manages all the other tags contained in the workspace we imported in previous steps.

We need to extract the identifier (GTM-XXXXX) from our Google Tag Manager account. To do this, log in to our GTM panel, and we will find the identifier here:

Google Tag Manager Dashboard
Google Tag Manager Dashboard

Copy our identifier and follow these steps to enable Google Marketing Tools:

  1. Go to the admin area of Google Marketing Tools.
  2. In the “General” tab, enable “Google Marketing Tools status.”
  3. Paste our ID (GTM-XXXXX) into “GTM Container ID.”
  4. Press the “Apply” button to save the changes.
proccess to activate Google MArketing Tools in Opecart
Activating Google Marketing Tools in Opencart

Congratulations! You have successfully connected Google Analytics 4 with your Opencart store using Google Tag Manager. Remember that this integration will provide valuable insights into the performance of your website, user behavior, and e-commerce conversions. Make sure to regularly review GA4 reports and use that data to improve your marketing strategy and optimize your online store.

We create Opencart's extensions that take your online store to the next level.

Stand out from the competition and provide an exceptional shopping experience

Contact us today to revolutionize your  business.

Remember that connecting Opencart with Google Analytics 4 through Google Tag Manager allows you to have comprehensive tracking of your store’s performance and make data-driven decisions. If you want to learn more about e-commerce tracking in Opencart or enhance your analytical skills, feel free to explore other resources and tutorials available on our blog.

Additionally, we want to show you an example of how your Google Analytics 4 could look after the tutorial. This is a real example of a fully functional business.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top