Meta | How do I configure Meta's new data support requirements?
This article is a guide to implement Google Analytics enhanced conversions.
Difficulty- &
-Code changes required to support data layer.
Enhanced Conversions were introduced by Google Analytics to improve the accuracy of conversion measurement and improve ads bidding. First-party customer data, like email address, is collected and shared with google via secure one-way hashing algorithm (SHA256). Google combines user-submitted data with data from Google accounts to provide additional information about user demographics and interests.
California Law regulates the data that can be shared with third parties. Enhanced conversions comply with these regulations by hashing and collecting 1st party data.
User-Provided Data
A new utility variable type was introduce to support the encryption of user-submitted data. This variable is attached to Google Ads Conversion Tracking Tags.
Implementation - Google Ads
The first step is to enable enhanced conversion from you Google Ads account.
- Sign in to your Google Ads Account
- Click TOOLS AND SETTINGS > Measurement > Conversions
- Open the conversion action you with to enhance
- Open the conversion action you want to use for setting up enhanced conversions.
- Click Turn on enhanced conversions.
Implementation - Web/App
Collecting user-submitted data can be done in two ways -
- DOM Scraping - collecting the values put into specific fields. This can be hard to maintain and less accurate.
- ta Layer - pushing user-submitted data to the data layer for collection by Google Tag Manager (GTM). This method is considered best practice.
The data layer is an objected used for sharing data from your site with Google via Google Tag Manager (Documentation).
Utilizing data layer is more accurate because data is programmatically submitted and it is more maintainable because tracking is less likely to break due to code updates.
User PII is not automatically collected and sent to Google Analytics after pushing said data to the data layer. Instead, it is made available for collection as a data layer variable in GTM. The data layer variable is included as a User-Provided Data Variable. Finally, the User-Provided Data variable is attached to the Conversion Tracking Tag.
Data Layer Push
he window.dataLayer object has a method called push() that allows you to easily upload structured data for collection by Google Tag Manager (GTM).
Below is an example a data layer push which includes user-submitted data to support enhanced conversions. The important part to focus on is the user dictionary, other details are for demonstration purposes.
dataLayer.push({
'event': 'purchase',
'ecommerce': { … }, //omitted for brevity
'data':
{
user: {
emailAddress: '<<USER_EMAIL>>',
phoneNumber: '<<USER_PHONE>>',
firstName: '<<USER_FIRST_NAME>>',
lastName: '<<USER_LAST_NAME>>',
street: '<<USER_STREET>>',
city: '<<USER_CITY>>',
region: '<<USER_STATE>>',
country: '<<USER_COUNTRY>>',
postalCode: '<<USER_POSTAL_CODE>>'
}
}
})
User-Provided Data
The User-Provided Data variable is a requirement for enhanced conversions. It is how Google manages encryption of this data. There are two ways to configure this variable:
- Manual
- Code
User-Provided Data: Manual Configuration
you can see below, the user data dictionary (push above) matches the user-submitted data requirements for enhanced conversions.
In this example, each data layer variable is collected individually, using the dot (.) accessor to drill down to the exact variable (e.g., "data.user.city").
Implementation Steps:
- Capture each user-submitted value with a Data Layer Variable (ex. above)
- Match each Data Layer Variable with the corresponding User-Submitted Variable requirement under Manual Configuration and Save (two images past)
- Add the User-Provided Data Variable to your Conversion Tag (below)
User-Provided Data: Code Configuration
In the previous example (Manual Configuration), each individual variable was capture and mapped to the corresponding User-Submitted Variable required key. When using Code Configuration, you can provide just one structured data object. This method lends itself to the data layer push implementation.
With this approach, you should create a data layer variable for the data.user dictionary, which contains all user-submitted data, and provide that to the User-Provided Data Variable.
Implementation Steps:
- Capture the data dictionary with a Data Layer Variable (img1)
- Input the Data Layer Variable from Step 1 into the User-Provided Data Variable under Code Configuration and Save (img2)
- Add the User-Provided Data Variable to your Conversion Tag (img3
img1 - dlv - data.user
img2 - User-Provided Data Var
img3 - Google Ads Conversion Tracking Tag with User-Submitted Data Var
Validation
After implementing data layer support requirements and implementing enhanced conversions in Tag Manager, you may follow the following steps to validate your implementation.
From within the same Google Tag Manager workspace where you have created these variables, click Preview and input the URL where data layer support has been implemented.
Perform the actions required to complete a conversion and check Tag Assistant to ensure that user-submitted values were captured.
The example below is of a Manually Configured Conversion Tag using the data layer push provided above.
From Tag Assistant, find the tag and ensured it has fired when expected. Select 'Values' next to 'Display Variables as' then ensure that the values collected exactly match what was pushed to the data layer.
That's it! Now all that is left is to submit your Tag Manager workspace.