Real-Time Personalization migration from Universal Analytics to Google Analytics 4 (GA4)

ndalvi
Marketo Employee
Marketo Employee

In this article, we will delve into the changes made within Real-Time Personalization (RTP) during the migration from Universal Analytics to Google Analytics 4. The content will primarily consist of a combination of links to other web articles that provide examples and step-by-step explanations where necessary. These resources will enhance the understanding of the topic and provide valuable insights.

 

1. Introduction

This article aims to provide RTP customers with detailed steps for migrating configurations from Google Universal Analytics to Google Analytics 4. During this migration, you can expect to receive events either directly on the GA-4 Tag or through the GTM tag from our RTP application. The following sections will guide you through the migration process.

Before proceeding with the steps, it is important to determine which tag you are currently using on your website or landing page. You can do this by checking the active tag in the head section of your website's source code. Here are the possible scenarios:

  1. Universal Analytics: If you find a Universal Analytics tag (e.g., analytics.js) in the head section, it means you are using Universal Analytics.

  2. GA-4 Tag: If you find a GA-4 tag (e.g., gtag.js) in the head section, it indicates that you are using GA-4 directly.

  3. GTM Tag connected to GA-4: If you find a Google Tag Manager (GTM) tag in the head section, it means you are using GTM, which is connected to a GA-4 tag.

Once you have identified which tag you are using, you can proceed with the corresponding steps for migration.

 

If you have implemented Google Tag Manager (GTM) on your website, you can identify the GA-4 tag by finding a snippet in the head section of your site's source code. The tag will be in the format of (GTM-XXXXXXXXXX).

 

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
<!-- End Google Tag Manager -->

 

If you are exclusively using a GA-4 tag without any additional configurations, the snippet on your website will resemble the following example, with the tag appearing as (G-XXXXXXXXXX).

 

<!-- Google tag (gtag.js) -->
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
 
  gtag('config', 'G-XKZV8T8FFN');
</script>

 

2. Steps for migrating your RTP config with GA4

2.1. Using GA-4 tag and not utilizing GTM:

If you are solely relying on the GA-4 tag and not utilizing GTM, the following instructions will guide you on tracking events with Custom Dimensions,

Step 1: To access the Custom Definitions for your GA-4 property in Google Analytics, follow these steps:

  1. Log in to your Google Analytics account.
  2. Navigate to the Analytics dashboard.
  3. Click on the gear icon in the top-right corner to access the Admin panel.
  4. In the Admin panel, locate and select your GA-4 property.
  5. Within the property settings, you will find a section called "Custom Definitions."
  6. Click on "Custom Definitions" to access the configuration for these definitions.
  7. Custom Definitions are used to identify specific parameters within the events that are sent to your Analytics account.

By configuring the Custom Definitions, you can define and track custom parameters that are relevant to your analytics needs. This allows you to gather more specific and tailored data from your events.

 

image2023-6-20_16-50-37.png

 

Step 2: Before setting up the variables, please ensure that you create the Custom Definitions based on the dimensions configured within the RTP UI. To verify the event being sent from RTP to GA, refer to the information provided below:

RTP UI navigation: Account Settings → Domain → Google Universal Analytics

 

gtag("event", "RTP_GA_VISITOR_DATA", {
  dimension1: "Adobe Systems Incorporated",
  dimension2: "Marketing",
  dimension3: "Fortune500",
  dimension4: "Elite",
  dimension5: "2023R2_Test"
})

 

For example, the dimension1 corresponds to the Organization Index and will be displayed as RTP_Organization in your Google Analytics Dashboard. You can choose any name for the dimension that makes sense to you in this case.

 

2.png  

3.png

Step 3: The processing time for these Custom Dimensions by Google typically takes around 24 hours. After this period, you will be able to view and utilize them in your reports for filtering and other purposes.

In the meantime, you can verify if the events are being successfully sent to your Google Analytics dashboard by following these steps:

  1. Navigate to the "Reports" section on the left pane under "Home".
  2. Click on "Events" to access the Events report.
  3. Look for the event named "RTP_GA_VISITOR_DATA" and click on it.
  4. You will be presented with a screen where you can view the dimension values associated with the event.
  5. Please note that any newly recorded events may take up to 24 hours to appear in the Reports area.

Additionally, if you scroll down on the same screen, you will find the Custom Definitions you have configured, which can be utilized as filters (as shown in the second picture below).

 

4.png

5.png

Please note that in addition to the RTP_GA_VISITOR_DATA event, we also send two other events: Matched Segments and Campaigns. These events do not require Custom Dimensions and can be viewed in your reports in the same manner as the RTP_GA_VISITOR_DATA event. The event names for Matched Segments, Campaigns, and Remarketing are RTP-Segments, RTP-Campaigns, and RTP-Remarketing, respectively. However, please note that these events will only be sent if certain conditions are met on RTP's end.

 

2.2. Using GA-4 tag along with GTM

If you are utilizing a GTM (Google Tag Manager) Tag and want to track events with Custom Dimensions, you can follow the steps outlined below,

When sending data to the GTM (Google Tag Manager) Tag using the dataLayer.push() method, the data format will be structured as follows:

 

dataLayer.push({
    event: "RTP_GA_VISITOR_DATA",
    dimensionData: {
        dimension1: "Adobe Systems Incorporated",
        dimension2: "Marketing",
        dimension3: "Fortune500",
        dimension4: "Elite",
        dimension5: "2023R2_Test"
    }
})

 

In this format, the dimensions are encapsulated within the nested object dimensionData. To access each dimension, you can refer to them using the dimensionData object, such as dimensionData.dimension1 for dimension1 and its corresponding value.

By utilizing this format and correctly populating the dimensions within the dimensionData object, you can effectively send the data to the GTM Tag and have the Custom Dimensions captured for further processing and analysis.

 

Step 1: Navigate to your Google Tag Manager account and locate the Container ID, which corresponds to the unique identifier for your GTM tag. Once you have identified the Container ID, follow these steps:

  1. Access the Google Tag Manager interface by logging into your GTM account.
  2. Select the specific Workspace associated with your GTM implementation.
  3. Within the Workspace, you can manage and configure tags, triggers, and variables for your GTM implementation.

By accessing the Workspace associated with your Container ID, you can make changes, update configurations, and deploy various tags to your website or application.

 

6.png

7.png

 

Step 2: Within the Workspace, navigate to the left pane and select "Triggers". Follow these steps to set up a Trigger of type "Custom Event" with the Event Name as "RTP_GA_VISITOR_DATA":

  1. Click on "Triggers" in the left pane of the Google Tag Manager interface.
  2. Select the option to create a new trigger.
  3. Choose the trigger type as "Custom Event".
  4. In the field for "Event Name", enter "RTP_GA_VISITOR_DATA" exactly as specified.
  5. Configure any additional conditions or settings for the trigger, if needed.
  6. Save the trigger configuration.

By setting up this Trigger with the specified Event Name, you are instructing Google Tag Manager to listen for the "RTP_GA_VISITOR_DATA" event and perform any associated actions or tags when this event occurs.

 

8.png

Step 3: In the Google Tag Manager interface, follow these steps to set up custom variables under User-Defined Variables, which correspond to the dimensions set up inside RTP UI:

  1. Click on "Variables" in the left pane of the Google Tag Manager interface.
  2. Select the option to create a new variable.
  3. Choose the variable type as "Data Layer Variable".
  4. In the "Variable Name" field, enter the name of the dimension from the nested object as specified in the example (e.g., dimensionData.dimension1).
  5. Configure any additional settings or transformations for the variable, if required.
  6. Save the variable configuration.

By setting up these custom variables as data layer variables, you are instructing Google Tag Manager to retrieve the corresponding values from the data layer, specifically from the specified dimension within the nested object. This allows you to use these variables in your tags, triggers, or other configurations within Google Tag Manager.

 

 

9.png

10.png

Step 4: Similarly, you need to create five User-Defined Variables in Google Tag Manager with appropriate names of your choice. In this example, we have used the naming convention Dimension1, Dimension2, and so on. Once created, the User-Defined Variables will appear as follows:

  1. Dimension1: dimensionData.dimension1
  2. Dimension2: dimensionData.dimension2
  3. Dimension3: dimensionData.dimension3
  4. Dimension4: dimensionData.dimension4
  5. Dimension5: dimensionData.dimension5

Ensure that the Variable Names match the nested object structure and dimensions being sent from RTP. These User-Defined Variables will capture the corresponding dimension values from the data layer and make them available for use in tags, triggers, or other configurations within Google Tag Manager.

 

9.png

Step 5: Now, let's proceed to the "Tags" section in Google Tag Manager. Follow the steps below to create an event tag with the appropriate configuration:

  1. Click on "Tags" in the left pane.
  2. Create a new tag by clicking on the "New" button.
  3. Choose a suitable name for the tag and select the tag type as "Google Analytics: GA4 Event" (as shown in the image below).
  4. Add your GA-4 Tag as the configuration tag by selecting it from the dropdown menu.
  5. Specify the event name that you want to see in your Google Analytics Dashboard.
  6. Under the "Event Parameters" section, map the actual parameter names to the dimensions you created in step 4. This will associate the event parameters with the corresponding dimensions.
  7. Add the trigger that was created in step 2 under the "Triggering" section. This ensures that the tag is fired when the custom event is triggered.
  8. Save the tag configuration.

Note: Make sure to adjust the parameter names and dimensions according to your specific setup.

By following these steps, the GA4 Event tag will be set up in Google Tag Manager to capture the custom event data and send it to your GA-4 property in the desired format.

 

10.png

Step 6: In some cases, changes made in Google Tag Manager may take some time to propagate and reflect accurately. If you encounter any delays or issues with the newly created tag, you can try pausing and then resuming the tag after a short waiting period. Follow the steps below:

  1. Go to the "Tags" section in Google Tag Manager.
  2. Locate the newly created tag that you want to pause.
  3. Click on the tag to select it.
  4. On the right side of the screen, you will find a switch icon (pause/resume). Toggle the switch to the "Pause" position.
  5. Wait for a few minutes or as needed to allow the changes to take effect.
  6. Toggle the switch back to the "Resume" position to activate the tag again.

By pausing and then resuming the tag, you give it a chance to refresh and align with any updates made in the Google Tag Manager configuration. This can help ensure that the tag functions correctly and captures the desired event data.

Note: The actual waiting time may vary, so it's recommended to observe the changes and verify if the desired data is being captured before resuming the tag.

 

1.png

Step 7: Now, you can proceed to the preview screen in Google Tag Manager to debug your landing page or web page that contains both the RTP tag and the GTM tag. When you enable the preview mode, you will be able to observe and analyze the tag firing and data being sent. Here is an example of what you may see during the debugging process:

  1. Open your Google Tag Manager account and navigate to the workspace containing your tags.
  2. Click on the "Preview" button located in the upper right corner of the Google Tag Manager interface.
  3. A preview pane will appear, indicating that the preview mode is active.
  4. Visit the landing page or web page where the RTP and GTM tags are implemented.
  5. In the preview pane, you will see detailed information about the tags firing on the page, including RTP events and GTM events.
  6. Analyze the information provided in the preview pane to ensure that the events and data are being captured correctly.
    • Check for the firing of the RTP events, such as "RTP_GA_VISITOR_DATA," and verify that the associated dimensions are populated with the expected values.
    • Look for the firing of GTM events, including the configured GA-4 event, and confirm that the event parameters are mapped correctly.
  7. Use the debug information to troubleshoot any issues or discrepancies in the event data or dimensions.
  8. Once you have completed the debugging process and verified that the events and data are captured accurately, you can exit the preview mode by clicking on the "Exit Preview" button in the Google Tag Manager interface.

The preview and debug mode in Google Tag Manager provide valuable insights into how the tags are functioning on your landing page or web page. It allows you to validate the data being sent, verify the correct firing of events, and ensure that the custom dimensions and mappings are working as intended.

 

2.png

2.1.png

 

Step 8: Now, access your Analytics Admin screen and navigate to your GA4 property. Look for the Debug view within your property settings. In the Debug view, you will be able to observe the incoming events, including the event named "RTP_Organization" as configured in step 5 (refer to the second image).

  1. Log in to your Google Analytics account and select the desired GA4 property.
  2. Click on the "Admin" tab located in the lower-left corner of the Google Analytics interface.
  3. In the Property column, click on "Data Streams" and select the appropriate data stream associated with your GA4 property.
  4. From the data stream settings, click on "Debug View" to access the debug mode for your GA4 property.
  5. Within the debug view, you will be able to see the events being sent to your GA4 property, including the "RTP_Organization" event.
  6. Verify that the event is being captured correctly and that the associated dimensions are populated with the expected values.
  7. Use the debug view to troubleshoot any issues or inconsistencies in the event data or dimensions.
  8. Once you have reviewed the event data in the debug view and confirmed its accuracy, you can exit the debug mode and return to the regular Analytics view.

The debug view in Google Analytics allows you to inspect the events received by your GA4 property and ensure that they align with your configurations. It helps you validate the implementation of custom dimensions, track the data being sent from RTP, and ensure that the events are being captured accurately in your GA4 reports.

 

3.png

3.1.png

 

Step 9: Additionally, you can also view the values of the custom dimensions in the Reports section of Google Analytics. Navigate to the "Events" section, where you can find the event named "RTP_Organization" that corresponds to the custom dimensions configured.

  1. In your Google Analytics account, go to the "Reports" section.
  2. On the left-hand side, click on "Events" under the "Real-Time" or "Behavior" category.
  3. Look for the event named "RTP_Organization" in the list of events.
  4. Click on the event to view its details.
  5. Within the event details, you will be able to see the values of the custom dimensions configured, such as the organization index (e.g., dimension1).
  6. Verify that the custom dimension values are populated correctly for the event.

By accessing the Reports section in Google Analytics and exploring the Events category, you can review the data associated with the "RTP_Organization" event and ensure that the custom dimension values are captured accurately. This allows you to analyze and filter the event data based on the custom dimensions in your reports.

 

4.png

 

3. Summary

At this stage, regardless of whether you are using GA4 directly or integrated with GTM with RTP, you should start seeing the data related to RTP assets and events populated in your Google Analytics dashboards. This includes the custom dimensions, events, and other relevant information that you have configured.

If you encounter any issues or have concerns during the migration process, I recommend reaching out to the Marketo support team for assistance. They will be able to provide you with further guidance and help resolve any issues you may face.

Remember that successfully migrating and tracking data in GA4 is crucial for accurate reporting and analysis, so don't hesitate to seek support if needed.

3155
0