Configure Google Tag Manager Integration in the Back-Office
Integration between your Oro application and Google Tag Manager enables you to add tracking tags to your OroCommerce web store pages with the help of Enhanced E-commerce and collect information on customer behavior, purchases, product clicks, page views, etc. All this information can subsequently be shared with Google Analytics to measure various user interactions with products on your website through E-Commerce reports. This can help you get a full picture of on-page visitor behavior, how well your marketing strategies work, and how to target your audience better.
In this topic, we are going to illustrate how to integrate your Oro application with Google Tag Manager and pass data to Google Analytics using two methods:
- By importing a pre-configured container with pre-defined tags and triggers for all collected events, or
- By configuring tags for all required events manually
Please, be aware that you must have Google Tag Manager and Google Analytics accounts already created to proceed with the integration between your Oro application and Google Tag Manager, and pass data to Google Analytics.
Configure Google Analytics Settings
Retrieve Tracking ID
You require Google Analytics Tracking ID to configure your Google Tag Manager variable for the tag that tracks events on your OroCommerce website.
The Tracking ID is located in your Google Analytics account under Admin > Tracking Info > Tracking Code.
Keep the ID at hand when you start configuring tags in Google Tag Manager.
Enable Google Analytics Enhanced E-Commerce
Google Analytics Enhanced E-commerce enables you to get better insights into the shopping behavior of your web store users (e.g., by offering you out-of-the-box reports on products, brands, orders). It sends valuable data, such as product impressions, promotions, and sales data with any of your Google Analytics page views and events. You can use page views to track product impressions and product purchases, and use events to track checkout steps and product clicks.
You need to enable Enhanced E-commerce in your Google Analytics account and map your checkout steps to retrieve the data collected by Google Tag Manager on your OroCommerce website. Please keep in mind that in order for Enhanced E-commerce to retrieve and process information, you need to select Data Layer as a source of E-commerce data when configuring tags in Google Tag Manager.
To enable Enhanced E-commerce:
Navigate to your Google Analytics account, and click Admin > All Web Site Data > E-commerce Settings.
Toggle the switches to set Enable E-commerce and Enable Enhanced E-commerce Reporting to ON.
In the Checkout Labeling section, add your checkout steps to the funnel.
The following screenshot illustrates mapping of the checkout steps of the default OroCommerce web store.
Adding checkout steps of your web store enables you to track checkout behavior.
- Click Save
Google Analytics tracks only one currency at a time. This means that if, for example, your default currency is set to US dollars, but you have a multi-currency web store, a purchase of 100EUR will be tracked in the converted dollar amount of 113USD (depending on the currency rate that day). To set the default currency in your Google Analytics account, navigate to Admin > View Settings > Basic Settings > Currency displayed as.
Configure Google Tag Manager Settings
To collect information (events) from your web store, you need to create tags in your Google Tag Manager account for each event that you want to track. Enhanced E-commerce enables you to track and collect information about the following events:
- Page Views
- Product Impressions
- Product Clicks
- Add to Cart
- Remove from Cart
- Promotion Impressions
- Promotion Clicks
You can either import pre-defined tags that we have configured for all types of events that can be collected for Enhanced E-commerce, or create tags manually for those events that you would like to track. Importing pre-defined tags requires minimal efforts, as each tag has already been pre-configured with triggers and variables that will enable you to connect to your OroCommerce website. Creating tags from scratch requires more time but allows you to provide custom data during configuration, or create tags only for specific events.
Retrieve Container ID
You require Google Tag Manager Container ID to integrate with your Oro application.
The Container ID is located in your Google Tag Manager account on the top right of the workspace page. It is formatted as GTM-XXXXXX.
Keep the container ID at hand when you start creating an integration between Google Tag Manager and OroCommerce.
Option 1: Import Container
To simplify tag configuration, download a .json file with a container that includes tags that have already been pre-defined for your convenience. All you need to do is import this file into your Google Tag Manager account, and substitute the dummy Tracking ID in the variable to the Tracking ID of your Google Analytics account.
Follow the steps below to complete import:
Download the .json file with a pre-configured container.
Save and extract the archive on your computer.
In your Google Tag Manager account, navigate to Admin > Import Container.
Click Choose container file to import the extracted .json file. The file contains 10 tags, 9 triggers, and 6 variables.
Choose the workspace and import option.
Click Confirm to start file import.
The container that you have imported contains a dummy Tracking ID number. You need to change the ID to be able to transfer correct data to Google Analytics.
To change the tracking ID for the imported variable:
In your Google Tag Manager Account, click Variables in the left menu pane.
In the User-defined Variables section, click GA var to open its configuration page.
Click the Edit icon
Provide your Google Analytics Tracking ID number that follows the UA-XXXXXXXXX-1 instead of the dummy number.
Click Save to save variable settings.
Create and Enable Google Tag Manager Integration
To create a new integration with Google Tag Manager in your Oro application:
Navigate to System > Integrations > Manage Integrations in the main menu.
Click Create Integration on the top right.
In the Type fields, select Google Tag Manager.
In the Name field, provide the name for the integration you are creating to refer to it in the Oro application. Since you can create many Google Tag Manager integrations, make sure the name is meaningful.
In the Container ID field, provide the container ID that follows the GTM-XXXXXXX pattern. You can find container ID in your Google Tag Manager Account.
In the Status field, set the integration to Active to enable it. Should you need to disable it, select Inactive from the list.
In the Default Owner, select the owner of the integration.
Click Save and Close.
Once the integration is saved, it becomes available in the Integrations grid under System > Integrations > Manage Integrations.