Seamlessly integrate Google Analytics (GA04) with Zoho PageSense using Google Tag Manager (GTM). With GTM, you can effortlessly include and modify your code (tags) on your website without the need for manual coding. GTM is also a free tool, making the process even more convenient. By integrating GA04 through GTM, you can transmit your A/B Test and Split URL Test data to access detailed visitor metrics regarding the experiments conducted on your website directly within Google Analytics. This integration requires a one-time setup.
- To successfully integrate, please make sure you own a GTM account and have an active A/B Test or Split URL Test running on Zoho PageSense.
- Prior to following the steps below, log into your Google Tag Manager account and choose the Workspace you want to integrate with Zoho PageSense.
What is a custom HTML tag in GTM?
A custom HTML tag collects relevant data from the PageSense experiment and helps push it into GTM’s Data Layer Variable. This takes place by installing HTML elements to all the pages of that experiment by allowing you to insert a tag that isn't supported by Tag Manager yet.
To create a custom HTML tag in GTM:
1. Go to the left panel under Workspace and select Tags. Click New.
2. Enter your tag name as 'PageSense Custom HTML' in the Untitled Variable field.
3. Under Tag Configuration, select Custom HTML from the list of tag types displayed.
4. Copy and paste the below code inside the HTML window:
<script>
if(window.ZAB && window.ZAB.experimentsLoaded) {
window.ZAB.GAGTMIntegFunc();
}
if(document.addEventListener){
document.addEventListener("zpsExperimentsLoaded", function() {
window.ZAB.GAGTMIntegFunc();
}, false);
} else {
document.attachEvent("zpsExperimentsLoaded", function() {
window.ZAB.GAGTMIntegFunc();
});
}
</script>
5. Under Triggering, select All Pages with the trigger type as Page View.
6. Click Save.
What is a Data Layer Variable?
Data Layer Variable enables a Tag Manager to read values from the data layer implementation then passes those values to tags, triggers, and other variables.
Next, we need to create two Data Layer Variables in GTM. They help transfer the data of every test and variation created, into GA04. These variables are defined by the PageSense snippet.
To create a Data Layer Variable in GTM:
1. Go to the left panel under Workspace, select Variables and click New.
2. Enter your variable name as 'PageSenseExperimentName' in the Untitled Variable field.
3. Click the Pen icon to edit then select Data Layer Variable from the list.
4. Enter the following details under Variable Configuration, then click Save:
- Variable Type as Data Layer Variable.
- Data Layer Variable Name as ‘PageSenseExperimentName.’
- Data Layer Version as ‘Version 2’.
The process of creating both the Data Layer Variables are same, only the variation name differs.
5. To set up your second Data Layer Variable, navigate to the left panel, click Variables and click New.
6. Enter your variable name as 'PageSenseVariationName' under Data Layer Variable Type.
7. Click the Pen icon and select Data Layer Variable from the list.
8. Enter the following details under Variable Configuration then click Save.
- Variable Type as Data Layer Variable.
- Data Layer Variable Name as PageSenseVariationName.
- Data Layer Version as Version 2.
To create a trigger for custom event in GTM?
1. Under Workspace, in the left panel select Triggers and click New.
2. Enter the trigger name as 'zohoPageSenseEvent' in the Untitled Tag field.
3. Under Trigger Configuration, choose Custom Event from the list of trigger types displayed.
4. Enter your Event name as ‘zohoPageSenseEvent’ , select the trigger All Custom Events and click Save.
Why do we need to create a tag for GA04 in GTM?
To complete the setup process in GTM, you need to create a tag. These GA04 tags consist of code snippets that ultimately transmit the data captured by the variables triggered by 'zohoPageSenseEvent' to your Google Analytics account. All the information gathered from the ongoing A/B Test and Split URL Test experiments conducted through PageSense will then be pushed over to Google Analytics.
How to create a tag for GA04 in GTM:
1. Under Workspace, select Tags in the left panel, then click New.
2. Under Tags, enter your tag name as 'GA04 PageSense' in the Untitled Tag field,
3. Under Tag Configuration select Google Analytics: GA4 Event from the displayed list.
- To locate the Measurement ID in Google Analytics, refer to the pathway below:
Google Analytics 04 -> Admin -> Data Stream -> Select the domain -> Copy the Measurement ID (G-XXXXXXXXX)
4. Enter the following details under Tag Configuration:
- Select your Tag Type as None-Manually Set ID
- Enter the Google Analytics 04 Measurement ID for your website
- For Event Name, select PageSenseExperimentName and PageSenseVariationName, which should look like {{PageSenseExperimentName}}:{{PageSenseVariationName}}
5. Under Triggering, select Custom Event and zohoPageSenseEvent from the list.
6. Click Save.
7. Click Submit to apply the changes.
8. Provide your Version Name and Description to identify your tags.
9. Click Publish to make your tag public and begin using PageSense tools.
How to enable Google Analytics within Zoho PageSense:
After setting up GTM, you need to activate the integration with GA04 through PageSense.
To enable GA04 within PageSense:
1. In the left panel, click either A/B Test or Split URL Test, then choose the experiment report you would like to view in detail.
2. Click the CONFIGURATION tab located in the top bar.
3. Scroll down to Integrations and click the toggle to activate Google Analytics. Click here to be redirected to the integration section which you can enable Google Analytics from the list of available integrations.
How to view reports in Google Analytics:
Once you have integrated PageSense with GA04 via GTM, you can view the website's report for A/B Test and Split URL test within your Google Analytics account.
To view reports in Google Analytics:
Login to your GA04 account, on the left panel, click Engagement, then Events. You can view a summary of your test results as shown below.
The report provides an overview of all your original and variations of A/B Test and Split URL Tests in GA04.