Google Analytics 4 Integration
Overview
The Intelligems Google Analytics integration allows you to analyze experiment results within GA4. Once enabled, weโll send an event to GA on each page load indicating the active experiment(s) and test group(s) for the visitor. You can then use this dimension to segment users in GA4.
How it Works
Once youโve enabled the Intelligems GA4 integration, Intelligems will begin sending an event called experience_impression
to GA4 on each page load, with one event for each active experiment. Intelligems attaches a dimension to the event, Experience - variant ID
, which contains the name of the experiment and test group this visitor was in, in the following format:
Enabling the Intelligems <> GA4 Integration
Enabling the integration takes only 1-2 minutes:
In the Intelligems app, click on the โIntegrationsโ tab in the lower left section of the side nav, or navigate to the integrations page directly in your browser.
Within the โGoogle Analytics 4โ section, click โSign in with Google.โ Youโll need to sign in with a Google account that has access to your GA4 account, and sufficient permissions to authorize Intelligems.
Choose the stream youโd like Intelligems to send the data to. If you're unsure, follow the steps here to find your measurement ID.
Analyzing Experiments in GA4
To analyze experiment data within GA4, create a segment for each test group:
Create a new segment. From within an exploration, click the โ+โ button next to Segments.
Choose โUser Segmentโ.
Add a dimension to condition on, and choose โExperience - variant IDโ.
Choose โcontains,โ and find the test group youโre interested in analyzing (the pattern will follow the one detailed in the โHow it Worksโ section above, and should autocomplete). Check off โat any point in timeโ.
Click "Save and Apply" to save the segment. You can also create an Audience from the segment so that you can re-use it in other reports.
Additional Settings
If you would like Intelligems to add the event to the window.dataLayer
instead of using window.gtag
, add this snippet above the Intelligems script in your theme.liquid
:
Troubleshooting
There is not any Intelligems data in GA4
Make sure the GA4 integration is enabled in the Intelligems app
Note that data is sent only for active experiments, and only after the integration has been enabled. Data won't be sent retroactively for experiments that have already ended when the integration was first enabled
Make sure Intelligems and your Google Analytics scripts are both being loaded
Ensure window.gtag is available on your store. Intelligems uses GA's gtag API to send events. You can check this by loading your store in your browser and checking for window.gtag in the console
Make sure the stream and property chosen in the integration was correct (see above for instructions on how to check this)
There are fewer visitors tracked in my GA4 segments than in Intelligems analytics
Not every visitor to the experiment may be tagged with their test group in Google Analytics. Intelligems triggers the experience_impression
event almost immediately after loading, but GA often delays sending it to its server for a few seconds. This causes visitors who bounce quickly to be tracked in Intelligems, but not to be tagged in GA with their test group. It's common to see the number of visitors in GA4 segments ~80-90% of the number in Intelligems analytics. If you're seeing fewer than that, here are some things to check:
Ensure you've installed Intelligems directly rather than using the Shopify app embed. The app embed loads Intelligems asynchronously, which may delay the triggering of the
experience_impression
GA eventCheck the users that are not tagged with an Intelligems test group, and make sure they are real users by checking browsing behavior, time on site, and attributed revenue and orders. There are a number of different reasons GA will "make up" visitors
If you use the measurement ID in your Google tag is not the same as the one you've chosen in Intelligems, it may help to initialize that measurement ID directly. For example, if your GA4 measurement ID is
G-1234567890
and your Google tag looks like:Adding a
config
line for your measurement IDG-1234567890
may help ensure Intelligems events are sent successfully:
There are too many or too few orders & revenue compared to Intelligems analytics
Intelligems' order data comes directly from Shopify through server-side events. When order totals and revenue differ significantly between Intelligems and GA4, this is usually a problem with how your Shopify <> GA4 integration is configured. To diagnose the issue, you can download order exports from the Intelligems dashboard, and compare the included orders to order IDs In Google Analytics, by creating a GA4 report with order ID as a dimension.
We also recommend reaching out to a tracking specialist who can take a look at your GA4 setup. You can visit or partners page for experts.
Finding your GA4 Measurement ID
Go to Google Analytics and navigate to the Admin section.
Click on the stream associated with your online store. In many cases, there may be only one stream.
The measurement ID will appear in the drawer. It usually starts with โG-โ.
Last updated