Integrating with GA4 using Google Tag Manager
Depending on your GA4 setup, you may need to route the Intelligems experience_impression
event from the Data Layer to GA4 using Google Tag Manager. This step-by-step guide will help you set up the Tag in Google Tag Manager to do this.
Add an Intelligems setting so that the GA4 event is added to the Data Layer. In your theme code, above the Intelligems script in the <head> of the theme, add:
<script> window.igSettings = { useDataLayer: true } </script>
In Google Tag Manager (GTM), first create the Variable. Select "Variables" then "New":
Click on "Variable Configuration":
Choose "Data Layer Variable":
Enter
exp_variant_string
for Data Layer Variable Name, title the variableexp_variant_string
, and click Save:Now create the tag. Click "Tags" then click "New":
Click Tag Configuration:
Choose Google Analytics:
Choose Google Analytics: GA4 Event
Enter your GA4 Measurement ID, enter
experience_impression
as the Event Name, enterexp_variant_string
as the Event Parameter, and chooseexp_variant_string
as the Event Value by clicking on the variable picker icon (choosing the Variable we created in step 5):Click Triggering:
Click Trigger Configuration:
Choose Custom Event:
Enter
experience_impression
for Event Name, title the triggerexperience_impression
, and click Save:Click Submit:
Click Publish:
Give the version a name and click Continue:
Last updated
Was this helpful?