Overview
Omnyfy can provide a module to allow you to sync your Google Tag Manager Account with the marketplace through a module configuration. You will need the following:
- A Google account with access to the Google Tag Manager (preferably the Marketplace Owner / Company account as SEO or contractor accounts will need to have their Google Account signed in and the system can access any container). You will need to already have a Google Analytics set up already.
- Full admin access to the marketplace back end interface.
- A license to use the module (speak to our Omnyfy team about this, if not already provided)
See the configurations below.
Create a new container in Google Tag Manager
You will need to create a new container for your account. This assumes you already have a Google Account / Tag Manager set up. For more information on setting up your Google Account, you can use this guide:
Creating your Google Analytics Tracking Code- Navigate to your Google Tag Manager Accounts page: https://tagmanager.google.com/#/home.
- Click on the 3 dots on the upper right of the account to open the menu and select Create Container.
- When the pop up appears, input the Container name (typically the URL) and ensure Web is selected as the target platform.
- The container will then be created, and a pop up will open to show you the 2 codes that will need to be used for configuring the module. The 2 rectangles on the upper right of the code windows is the copy function, which you can use to copy the entire code.
You can choose to leave this window open, or copy this code into Notepad / Text Editor (ensure you separate it out in the document).
- In another tab/window, you will need to begin the module configuration.
Module Configuration
Accessing the configurations
Once you have the new container created, you can configure the module from the back end.
- In another tab/window (if you haven't already), open the marketplace admin URL and log in as an Administrator.
- Navigate to Stores > Settings > Configuration.
- From the configurations menu on the left, select Anowave > Google Tag Manager.
General Options
Here, you will only need to populate these 2 fields:
- Google Tag Manager Code (Head): Paste the first code of the head from Google Tag Manager (copied from above) here.
- Google Tag Manager Code (Body): Paste the second code for the body (copied from above) here.
- Enable: This field can be used to enable/disable the GTM code on the marketplace.
- License: This should be prepopulated already by Omnyfy if available - so you will not need to do anything here.
- Use GTM split snippet: This should be set to Yes (This splits up the code between Head and Body)
The rest of the fields are not required for this section. Save this first.
Once saved, scroll down to continue to the Google Tag Manager API settings.
Google Tag Manager API
This is where you will need the Google Account Login.
You will only need to action the following fields:
- Authentication: Sign in with the Google Tag Manager Account Holder here. Simply follow the steps to sign in and allow all access - this first step is required.
- Once signed in, Authentication will then change to create the tags.
- Ignore these for now - you will need to have your Container ID and Account ID (with full permissions) set first.
- Once selected, input the following fields:
1. Measurement ID: This will need to be obtained through your Google Analytics account (not Tag Manager). Navigate to your Data Streams and and select the Data Stream.
2. Measurement API Secret: From the same Data Stream interface, copy your Measurement API Secret. Follow the instructions to create an API Secret for this Data Stream.
3. Account ID: This can be found in your Google Tag Manager account UI. Navigate to Admin > Account Settings.
- Select Save Config (from the top right).
- Once the configuration is saved, navigate back to Google Tag Manager API, and select the Container ID (of the new container you had created). The dropdown will sync with the available containers from this account.
- When your container is selected, scroll back to the Authentication screen and select these tickboxes:
- Create variables (Google Analytics 4)
- Create triggers (Google Analytics 4)
- Create tags (Google Analytics 4)
- Create GA4 Configuration tag (since it's a fresh container)
- Select Save Config again. This time it will take longer to save, as the tags, triggers and variables are being created.
Enhanced Ecommerce Tracking Preferences
Here there are only 2 fields you need to configure.
Brand attribute: This should be mapped to the appropriate Product Attribute in the marketplace (typically named Brand).
Impression payload model: This should be set to after Pageview.
To verify that your account has been linked, in Google Tag Manager, navigate to the Tags menu for this container.
Before you created the tags, this section would be empty. When you chose the Container ID and created the GA4 tags, variables and triggers, these would be populated from the system. You can check the Triggers and Variables
Triggers:
Variables:
Ecommerce data may take some time to sync - sometimes lagging a couple of days. Standard page views will be instantaneous.
If you do not see any tags, please try select the options in the configuration again, and ensure the correct Container ID is selected (and all of the other fields such as Measurement ID, API Secret and Accound ID are correct). If it still does not provide you with any tags, you may need to check that the Google Account you are using has the correct permissions. Your Google Account that you sign in with MUST have the permissions to create tags.
Changing the Cookie Type from 3rd Party to 1st Party
Since the change of GA4, Google Analytics is now a 1st Party Cookie type rather than 3rd Party. When the Cookie type is 3rd Party, this may prevent the Google tag from loading properly, and omitting the src link from the code snippet. By default, GA4 is set as a 3rd Party Cookie Type from Omnyfy, so this will need to be reconfigured so that the tags will display correctly on the front end. This can be implemented before or after you have already configured the GA4 module - however this must be done for the code to display correctly.
1. As an admin, navigate in the back end to Customers > Cookie Consent > Cookies.
2. Scroll to the bottom until you find the _ga Cookie Name line item. Select Edit from the right side, if you can see that the Cookie Type is set to 3rd Party. You may skip this section entirely if it is already set to 1st Party.
3. Once on the Edit screen for this Cookie, scroll to the Cookie Type dropdown, and select 1st Party - then select Save.
You may need to clear your cache after. Note that this will not work until your GA4 module has been configured.
If you have any problems, please consult with your Omnyfy Support Team