The Google Analytics 4 connector is an Experience OS extension that enables you to analyze your web campaign performance with session analytics in your Google Analytics account.
The Google Analytics 4 connector enables you to analyze Dynamic Yield campaign results in your Google Analytics account with Google Analytics 4 (GA4). When the connector is activated, every time a user is served with a Dynamic Yield variation, a Google Analytics event is sent with the variation information. You can then create reports in Google Analytics, filtered by users who were served any variation or campaign, using Google Analytics metrics and reporting capabilities.
If you're using our legacy Google Analytics integration, we recommend you deactivate it and use this connector instead. It includes additional attributes you can pass to the analytics platform, such as campaign, variation, and experience IDs.
Setting up the connection with Google Analytics 4
Go to Experience OS Store › Google Analytics 4 and click Install.
The extension is now active in Experience OS, and appears in the Web Personalization app. By default, a Google Analytics event will now be fired upon every impression in your client-side campaigns (that is, all campaigns except the server-side Custom API and Recommendations API campaigns).
After you serve at least one campaign, go to your Google Analytics account and configure the following:
Note: Make sure that you have implemented the gtag script on your website
- Go to Admin › Property › Custom Definitions.
- Click Create custom dimensions.
- Create an event-scoped custom dimension for each parameter of the DY Variation Impression event.
Name each one based on the dimension according to which you want to filter reports, and select the event parameter with that name in the Event Parameter dropdown.
The list of dimensions are:
After you complete the configurations, it might take a short while until data is available for analysis.
Note: If Active Cookie Consent is enabled, data is sent only for users who consented to cookies.
Analyze campaign results in your Google Analytics account
Go to the Events report (Reports › Engagement › Events), and filter the report by any of the following parameters: campaign name (or ID), experience name (or ID), or variation name (or ID). This gives you some insights into the behavior of users who were exposed to these entities.
- Open Explore and select Free form from the template gallery.
- Create a segment to isolate users who have seen a specific variation. For example, include users who triggered the dy_variation_impression event, where the custom dimension you created corresponds to the variation you are interested in.
- Click Save and then Apply. Repeat for other variations.
- Apply the segments you just created to the visualization, and add metrics and any additional dimensions.
Disable Google Analytics 4 for individual campaigns
By default, the connector triggers Google Analytics events for all of your campaigns. However, you can disable (and re-enable) it for individual campaigns using the Track campaign performance toggle in the Create Campaign screen. Note that if you have the Analytics Platform Integration connector installed, it will stop sending events to that extension as well.