This integration enables you to analyze Dynamic Yield campaign results in Google Analytics 4. The integration works by sending an event to Google Analytics each time a user is served with a Dynamic Yield variation. This enables you to connect the variation assignment done in Dynamic Yield to all metrics available in Google Analytics.
If you use visitor data privacy management, the data from any users who opted out using any method is not sent to Google Analytics.
Integrating with Google Analytics
- Go to Settings › Integrations and click Google Analytics.
- In the sidebar, click the Enable Integration slider.
- Select the Google Analytics Implementation type.
- Use the Tag Manager option to integrate with Google Analytics 4. Tag Manager lets you populate your data layer with campaign information that you can then use to trigger Google Analytics events in the Tag Manager. To configure this type of integration, continue to the next step
-
Universal and Classic are earlier versions of the Google Analytics script, and they remain available until the product sunset. If you select one of these options, just click Save and your integration is complete. You can now skip to Disabling the Integration for Individual Campaigns.
Note: The Universal and Classic integrations assume you have only one Google Analytics object on your site. If you have multiple objects on the same page or renamed your Google Analytics object, the integration won't work, as Dynamic Yield won't know which Google Analytics property to send the events to. In this case, use the Tag Manager implementation type instead.
- In the Data Layer Name field, enter dataLayer unless you've modified the code Google Tag Manager provides. In the GTM Event Name field, enter a name of your choice. In this documentation, we use dy_variation_impression.
- To verify that dataLayer events are populated, visit a page or screen on your property, where one of your campaigns is running. Open the browser console and inspect the dataLayer. You should see that the integration triggered the dy_variation_impression event. The event has two properties, which you will use next in Google Tag Manager:
- eventAction, containing the campaign name
-
eventLabel, containing the experience name followed by the variation name in parentheses.
- Now move to Google Tag Manager:
-
- Unless you have such variables already, create a dataLayer variable for each property in the dataLayer event: eventAction and eventLabel.
You now have two variables: - Create a trigger to fire on dataLayer event name: dy_variation_impression
- Create a tag of type GA4 Event, named DY Impression Event. In Event Parameters, specify two parameters for dy_campaign_name, dy_experience_variation_name, populating them with the variables you created in the previous step. Configure the tag to run on the trigger you created.
- Preview your container. Visit a page where a Dynamic Yield campaign is running and make sure the Google Analytics event is fired correctly. You can also use the Google Analytics 4 real-time dashboard to verify events are received.
- Unless you have such variables already, create a dataLayer variable for each property in the dataLayer event: eventAction and eventLabel.
Disabling the integration for individual campaigns
When the Google Analytics integration is enabled, data is sent about each of your campaigns. However, you can disable it for individual campaigns.
- When editing a campaign, click the edit icon in the top section to edit the campaign settings.
- In Advanced Settings, disable the Fire Google Analytics event toggle.
Using Dynamic Yield events in Google Analytics 4
- In Google Analytics 4, go to Admin › Property › Custom Definitions and click Create custom dimensions. We will create an event-scoped custom dimension for each of the parameters of the dy_variation_impression event. For example:
- Go to Reports › Engagement › Events.
- Filter for event dy_variation_impression. Optionally filter for a specific parameter name and value, for example, filtering by parameter dy_campaign_name. You should see that events are received and that their properties are set.
Creating reports in Google Analytics to view Dynamic Yield data
You can set up custom reports in Google Analytics 4 by creating an Exploration. For example, you might want to set up a freeform exploration as follows:
- 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 have the dy_variation_impression event, where the custom dimensions you created correspond to a variation you are interested in. Click Save and Apply. Repeat for other variations.
- Apply the segments you just created to the visualization, and add metrics and any additional dimensions.
Using Dynamic Yield events in Google Analytics Universal
With the exception of Dynamic Links, Dynamic Yield experiences send information to Google Analytics as events:
- In Google Analytics, go to Behavior › Events › Overview.
- Search for events named DY Smart Action or DY Smart Object under the Event Category. These two categories are based on legacy names for Dynamic Yield campaigns. They have reports on different types of campaigns enabled in Dynamic Yield for the integration. Click them to see more information.
- Click Event Action as the primary dimension to see details about campaigns. Click Event Label as the primary dimension to see details about each variation.
Creating reports in Google Analytics to view Dynamic Yield data
You can also set up custom reports in Google Analytics account under ‘Customization’:
- Add a filter including: Event Category or Event Action, or Event Label and search for any Dynamic Yield event such as DY Smart Action:
- You can add metrics, as many as required, such as ‘Bounce Rate’, or ‘Exit Rate’. This enables you to view the variation data breakdown in your Google Analytics account alongside any additional metrics you've included.
- You can also create segments with the condition of any Dynamic Yield event. This enables you to view and break down the data on the fly.
Data discrepancies between Dynamic Yield and Google Analytics
For various reasons, you may notice discrepancies between the metrics collected by Dynamic Yield and those collected by Google Analytics, such as pageviews, users, and conversions. Most of the time, these discrepancies are due to differences in how the data is presented, and do not represent actual discrepancies in the data. However, we recommend using the following procedures to ensure that there are no problems. Perform the following procedures until the data in Dynamic Yield is within 5% of the data in Google Analytics. If you can't resolve the issue after performing these procedures, open a support ticket.
New user calculation
Users are tracked differently in Dynamic Yield and Google Analytics, and this generally results in a higher number of new users in Google Analytics, but a more accurate number in Dynamic Yield.
In Google Analytics, users are tracked with cookies in their browsers. If they delete their cookies, they will be seen as a new user.
In Dynamic Yield, users are tracked with both cookies in their browser and local storage. Dynamic Yield recognizes them as returning users even if they delete their cookies.
Investigating general data discrepancies
- Open the Dynamic Yield dashboard and look at the Site Performance metrics (users, purchases, conversions, and so on).
- In Google Analytics 4, compare these metrics to the ones found in the Google Analytics home, or any report that includes all traffic through your property where Dynamic Yield is implemented (usually all).
In Google Analytics Universal, compare these metrics to the ones found in the Ecommerce and Audience overviews in Google Analytics.
Conversions › Ecommerce › Overview
Audience › Overview
The metrics should be within 5% of each other. If they are not, keep investigating by continuing with this procedure. - Ensure the Google Analytics and Dynamic Yield scripts are implemented on the same pages. Sometimes a subdomain or subdirectory may be overlooked.
- Make sure the two platforms are using the same IP filters. In Google Analytics, filtering is defined in “Views”. In Dynamic Yield, see IP Filters.
- Make sure the two platforms are using the same time zone. In Dynamic Yield, you can view your time zone by going to Settings › General Settings and clicking the edit button next to the site name at the top of the page.
- If you notice greater discrepancies in Revenue vs. Purchase events, check that the event value for the Purchase events sent to Google Analytics and that Dynamic Yield follows the same definitions (for example, shipping or discounts).
- If there are still discrepancies greater than +/-5%, open a support ticket.
Investigating experience and variation data discrepancies
If all general data discrepancies have been resolved (see above), but you still see discrepancies in the data about individual experiences or variations, do the following to investigate:
- In Dynamic Yield, select a campaign that is part of the integration and view its report. In the time range, select a version (current or previous). Note the dates of the version must use the same time range in Google Analytics.
- In the Experience settings, look at the Variation Stickiness setting. If it is Sticky for the Session, compare the report to the equivalent Google Analytics report on sessions. If the Variation stickiness is Sticky for the User, compare the report to the equivalent Google Analytics report on users as follows:
- Create a segment in Google Analytics of users who triggered the event.
- Make sure the segment is filtered by users, not sessions.
- If there are still discrepancies greater than +/-5%, open a support ticket.
Troubleshooting: Why is my campaign data not showing up in Google Analytics?
If you’re not seeing any data for your campaigns in your Google Analytics reports, here are a few troubleshooting steps to confirm that the integration has been set up correctly.
Check whether Google Analytics is collecting any hits or events on your site
There are various tools you can use to check your Google Analytics implementation and verify what data is being collected. Here are two browser add-ons that can help you determine whether Dynamic Yield events are being collected successfully:
- GTM/GA Debugger
- Tag Assistant Legacy (by Google)
With the GTM/GA Debugger tool, you can record Google Analytics collection activity that occurs on the page and see where it is sent. You can also inspect the activity further to see additional details.
With the Tag Assistant Legacy tool, you can see information about what is being collected by Google Analytics, and review related hit and event data in your data layer.
Verify the Google Analytics implementation method on your site
There are several out-of-the-box Google Analytics integrations in Dynamic Yield. It’s important that you choose the correct one to ensure the implementation works as expected. Google Analytics Classic, Google Analytics Universal, and Google Analytics 4 are implementations based on the Google Analytics version. The Google Tag Manager triggers events based on information populated in the data layer (for more information, see the Integrating with Google Analytics section).
Tag Assistant Legacy and GTM/GA Debugger tools for this, as well.
Ensure the Google Analytics toggle is enabled for your campaigns
Check the campaigns that are not displaying data in Google Analytics and verify that the Fire Google Analytics events toggle is in the On position.
Ensure that the tag’s trigger matches the event name in Dynamic Yield (Google Tag Manager implementation only)
If you've implemented Google Analytics on your website through Google Tag Manager, it's important to verify that the Event Name set in the Dynamic Yield integration matches the name of the Custom Event Trigger in the Google Tag Manager tag. If they do not match, you might see the event in your data layer, but it will not trigger the tag in Google Tag Manager.
Event name in DY integration:
Custom event name in GTM trigger:
Review campaign events in your data layer (Google Tag Manager implementation only)
If you have implemented Google Analytics on your website through Google Tag Manager, it has probably been implemented alongside a data layer. Try monitoring the events and hits that are sent to your data layer. Make sure that the Dynamic Yield campaign events are being pushed to the data layer and are not being overwritten before they are collected by Google Analytics.
You can check your data layer by entering dataLayer in the console tab of your browser’s dev tools. You should see something similar to this image: