GTM-Universal
Creating a Google Analytics (UA) Account
-
Go to Google Analytics
-
Sign in with your Google account.
-
Click on Start Measuring.
-
Enter an account name. Use a descriptive name, so you can easily tell what this account is for when you see it in the list of accounts.
Enter the property name and click on Show advanced options. Use the name of your website or app, so you can easily identify what this property is used for.
-
Enable the toggle button to create a Universal Analytics property and enter your website URL for which this property will be used.
Click on Create a Universal Analytics property only because the other option (GA4) is still in the beta stage.
-
Fill in all other business details and click on Create.
-
Read and accept the terms of service.
-
You have successfully created your Google Analytics account. Note down your property's tracking ID as shown below. This tracking ID will be used while creating a GTM tag.
Creating a GTM Account
-
Click on All Web Site Data as shown in fig. 9. Go to Tag Manager (2nd icon) and click on Get started.
-
Click on Create Account.
-
Enter a descriptive account name and select your country.
-
Enter a container name and target platform. In this example, we will analyze user behaviour on desktop and mobile web. Therefore, let's select Web as the target platform.
-
Read the Terms of Service and click Yes (if you agree to those terms).
-
You have successfully created your GTM account. Note down your Container ID as shown below. This container ID will be used to integrate GTM with the Fynd Platform.
Integrating GTM with Fynd Platform
-
On Fynd Platform, go to the Settings screen of your sales channel and click on Integration.
-
Click on GTM.
-
In the API Key, paste the container ID (copied from step 1). Enable this integration using the toggle button and click Save.
It may take up to 5 minutes for your GTM code (container ID) to reflect in your page source.
-
Go to your website, then right-click and select View Page Source.
-
Use Ctrl+F and type gtm. If you can view the container ID in your page source, your GTM integration is successful.
Creating a GTM tag
Once the GTM code is integrated with Fynd Platform, you can start creating GTM tags.
-
From the left-panel, go to Tags and click New.
-
Enter a descriptive tag name. We have used Count View-All Tag to indicate that this tag will be used to count the number of times, users have clicked the View All link on the website.
-
Choose Google Analytics: Universal Analytics.
-
Enter Event as your Track Type. Choose pre-defined options or write your own Category, Action and Label.
The event category and event label entered by you will be shown as-it-is on Google Analytics page.
-
From the Google Analytics Settings drop-down, select New variable...
-
Enter the Tracking ID of your Google Analytics account.
You have seen in Creating a Google Analytics Account section, how to obtain the Tracking ID (refer to the image below).
-
Once you have created a tag, it's time to create a trigger. A trigger is nothing but an event which will fire the GTM tag (in this example, we will count the number of times users click the VIEW ALL link). The event can be any activity that a user performs on the website.
-
Choose a trigger type. In this example, let's choose Click-All Elements Trigger.
-
Select Some Clicks because you don't want to trigger (fire) your tag on every click made by the user.
-
Select Choose Built-In Variable from the drop-down.
-
Let's choose Click Text.
-
In this example, the website contains a VIEW ALL link on its home page. Let's enter VIEW ALL in the field so that whenever a user clicks on that link, the tag gets triggered.
-
Enter the trigger name and save it.
-
Click on Submit near the top of the window.
-
Write a version name and description of this trigger. Click on Publish.
Each time you publish your tag, you'll have to enter the version name and description.
Previewing your GTM tag
-
GTM allows you to test your tag. Click on Preview near the top of the window.
-
Enter the URL of your website that is tagged with GTM.
-
Wait for the Tag Assistant to connect to your website.
-
Your website will be open in a new tab along with a debugger.
-
In the previous tab (Tag Assistant), you can cross-check whether the debugger (preview) mode is successfully connected.
-
Since we have created a VIEW ALL trigger, let's click the VIEW ALL link on the website's homepage.
-
In the previous tab, under Tags Fired section, you can see that the Count View-All Tag is triggered.
-
Your tag is functioning successfully. Now you may stop the debugger.
Using Google Analytics to view GTM output
-
In the left-panel of your Google Analytics page, go to Realtime --> Events. Here, you can view the real-time data of users on your website, which includes the number of times, the VIEW ALL link was clicked on the website.
The Event Category and Event Action were entered in step 4 while creating a GTM tag
-
You can also view the graphical and numerical representation of mobile and web users. The Events graph shows the number of times your GTM tag got triggered.