Set up enhanced conversions for web using Google Tag Manager

Enhanced conversions for web is a feature that can improve the accuracy of your conversion measurement. It supplements your existing conversion tags by sending hashed first-party conversion data from your website in a privacy safe way. The feature uses a secure one-way hashing algorithm called SHA256 on your first-party customer data, such as email addresses, before sending to Google. The hashed data is then matched with signed-in Google accounts in order to attribute your campaign conversions to ad events, such as clicks or views.

This article describes how to set up enhanced conversions for web using the Google Tag Manager. You can also set up enhanced conversions for web with the Google tag or set up enhanced conversions for web with Google Ads API.

Note: Conversions measured by importing Google Analytics goals aren't supported for enhanced conversions. If you'd like to use enhanced conversions, consider setting up a new Google Ads conversion action with the Google tag or Google Tag Manager.

Before you begin

Review the following requirements before starting setup:

  • Know the conversion page URL where the conversion tag fires (such as the confirmation page URL) and the conversion event trigger (for example, a button click or a page view).
  • Make sure there is first-party customer data available (email, full name and home address, and/or phone number) on the page where your conversion tracking tag fires.
  • This implementation requires knowledge of how conversion tracking is set up on your website and some code changes, so make sure you're able to speak with your development team as needed.
  • Ensure that you've reviewed and confirmed that you can comply with the enhanced conversion Customer data policies in Google Ads (view steps on this below, under Instructions).
  • If you set up conversion using URL, you can only set up enhanced conversions using the JavaScript or CSS selectors options or automatic enhanced conversions.
Note: We’ve made a series of updates to help you better understand the impact of enhanced conversion to your reporting. You can now see the impact of your enhanced conversions with new results available in your conversion action table. Learn more about Enhanced conversions for web impact results.

Instructions

  1. In your Google Ads account, click the Goals icon Goals Icon.
  2. Click the Conversions drop down in the section menu.
  3. Click Settings.
  4. Expand the “Enhanced conversions for web” panel.
  5. Check “Turn on enhanced conversions for web”.
  6. Review compliance statement. To enable enhanced conversions you must confirm that you'll comply with our policies and that the Google Ads Data Processing Terms apply to your use of enhanced conversions. Click Agree to acknowledge your acceptance of these terms.
  7. Click the dropdown to choose a method for setting up and managing user-provided data. Select “Google Tag Manager”.
    • Note: If you send Google enhanced conversions data in a way that’s different from what you’ve already selected in Google Ads, that data may not be processed. For example, if you select “Google tag” and try to send data through API, the data sent through API won’t be processed.
  8. If you’re not sure which tagging method to select, click Which method should I use? Enter your website domain and click Check URL to view suggestions.
  9. Click Go to Google Tag Manager and follow the instructions below to complete the setup process in Google Tag Manager.

Complete Enhanced Conversions Setup in Google Tag Manager

There are 3 ways to set up enhanced conversions in Google Tag Manager:

  1. Automatic collection: This method allows the tag to automatically detect user-provided data on the page. It’s the quickest and easiest setup method, but it’s not as reliable as adding a code snippet to your website or specifying CSS selectors or Javascript variables.
  2. Code: Add a code snippet on your website that sends hashed customer data for matching. This method improves the accuracy of enhanced conversions by ensuring that you consistently send properly formatted data whenever your conversion tag fires.
  3. Manual configuration: Manually specify CSS selectors or Javascript variables on your page that contain relevant user-provided data. This method is more precise than automatic detection, but not as reliable as adding code to your website. If you frequently change your website code, in particular the formatting or CSS Selectors on your conversion page, you may want to consider using data layer variables instead or the “Code” option, as changing your website formatting could disrupt the CSS Selector method.

Note: It is a best practice to use the ID attribute to retrieve the value from a DOM element. IDs are unique and less likely to change over time than other properties, such as class names or names. They also aren’t affected by layout changes, which means that your code will still work even if the layout of your page changes.

If a field doesn’t already have an ID, you can add one by using the id attribute in the HTML. For example:

<input type="text" id="myTextField">

After you complete setup in Google Tag Manager, you can validate your implementation to make sure enhanced conversion is set up correctly.

Note: After about 30 days you’ll be able to view the impact of enhanced conversions on your reporting. Learn more about Enhanced conversions for web impact results.

Set up enhanced conversions using “automatic collection” in Google Tag Manager

You can set up automatic enhanced conversions in 2 different ways:

  • Standard automatic enhanced conversions: Use this method when user-provided data (email, phone number, or address) is available on the conversion event page. For example, if your conversion event page is the purchase confirmation page and user email is visible on that page, use this method.
  • Automatic enhanced conversions with the user-provided data event tag: Use this method when customer data (email, phone number, or address) isn't available on the conversion event page, but is available on a previous page. For example, if your conversion event page is the purchase confirmation page and user email is entered on a page prior to the purchase confirmation page, use this method.
Note: If you use the user-provided data event tag method, first-party customer data such as email, phone, and address will be automatically detected on pages that users visit before reaching the conversion page. With this setup, you authorize Google to use an ads cookie to collect hashed, first-party customer data on your behalf and to connect that data with subsequent conversion events occurring within the same user session on your behalf. All data that isn't connected to a conversion is deleted. If you implement Consent Mode, the ads cookie will be subject to the ad_storage consent status of the Consent Mode feature, where implemented.

Set up standard automatic enhanced conversions

  1. Sign in to your Google Tag Manager account.
  2. Click Workspace, then click Tags from the navigation menu.
  3. Select the Google Ads conversion tracking tag that you’d like to implement enhanced conversions with and edit that tag.
    • Make sure that this conversion action has the same conversion tracking ID and label as the conversion action that you enabled enhanced conversions for in your Google Ads account.
  4. Click Include user-provided data from your website.
  5. In the dropdown, select New Variable or use an existing variable if you’ve already set one up.
  6. Select Automatic collection.
  7. Click Save for the variable and then save the conversion tracking tag.

Set up automatic enhanced conversions with the user-provided data event tag

  1. Sign in to your Google Tag Manager account.
  2. Click Workspace, then click Tags from the navigation menu.
  3. Click New to create a new tag.
  4. Click Tag Configuration and select Google Ads User-Provided Data Event.
  5. Fill in your Google Ads Conversion Tracking ID.
    • Make sure that this conversion action has the same conversion tracking ID and label as the conversion action that you enabled enhanced conversions for in your Google Ads account.
  6. In the dropdown, select New Variable.
  7. Select Automatic.
  8. Name the variable.
  9. Click Save.
  10. Click Triggering in the Google Ads User-Provided Data Event Tag. This is where you anticipate that the user data will be available.
  11. Click the plus icon.
  12. Click Trigger Configuration.
  13. Click Form Submission.
    Note: You must select “form submission” for enhanced conversions to work properly.
  14. Select All Forms.
  15. Select Save and then save your new Google Ads User-Provided Data Event tag.

Set up enhanced conversions using “manual configuration” in Google Tag Manager

Find enhanced conversions variables

  1. Using the Chrome browser, navigate to the page where user-provided data appears.
    • User-provided data may appear on the conversion page of your website or on a page that comes before the conversion page, such as a form submission page that comes before your purchase confirmation page. Identify any customer data that is displayed on the page that you wish to send to Google. As an example, your page may display a thank you message and include a customer email address after a purchase.

      Note: At least one of the following fields must be provided:

      • Email (preferred)
      • Address - First name, last name, postal code, and country are required.
        • Optional: Street address, city, and region as additional match keys.
      • A phone number can also be provided as a standalone match key but is recommended to be sent along with an email.
  2. Once you've identified the customer data on the page, you'll now need to follow the next step to copy the CSS Selectors and enter those into Google Tag Manager (or utilize existing data layer variables if they already exist) so your enhanced conversion tag knows which pieces of data to hash and send to Google. It’s important you keep this conversion page tab open.

Enable enhanced conversions in Google Tag Manager

In a separate tab, open Google Tag Manager.

You can set up manual enhanced conversions in 2 different ways:

  1. Standard manual enhanced conversions: Use this method when user-provided data (email, phone number, or address) is available on the conversion event page. For example, if your conversion event page is the purchase confirmation page and user email is visible on that page, use this method.
  2. Manual enhanced conversions with the user-provided data event tag: Use this method when user-provided data (email, phone number, or address) isn't available on the conversion event page, but is available on a previous page. For example, if your conversion event page is the purchase confirmation page and user email is entered on a page prior to the purchase confirmation page, use this method. In this method, you’ll identify CSS selectors and Javascript variables that contain user-provided data on pages that come before the conversion page.
Note: If you use the user-provided data event tag method, first-party customer data such as email, phone, and address will be automatically detected on pages that users visit before reaching the conversion page. With this setup, you authorize Google to use an ads cookie to collect hashed, first-party customer data on your behalf and to connect that data with subsequent conversion events occurring within the same user session on your behalf. All data that isn't connected to a conversion is deleted. If you implement Consent Mode, the ads cookie will be subject to the ad_storage consent status of the Consent Mode feature, where implemented.

Set up standard manual enhanced conversions

  1. Sign in to your Google Tag Manager account.
  2. Click Workspace, then click Tags from the navigation menu.
  3. Select the Google Ads conversion tracking tag that you’d like to implement enhanced conversions with and edit that tag.
    • Make sure that this conversion action has the same conversion tracking ID and label as the conversion action that you enabled enhanced conversions for in your Google Ads account.
  4. Click Include user-provided data from your website.
  5. In the dropdown, select New Variable or use an existing variable if you’ve already set one up.
  6. Select Manual configuration.
    • You may also select “Code” if you'd like to use Custom Javascript or other data objects to send your data through Google Tag Manager. This method requires data to be formatted in a particular way, so if you’d like to do this, you can read the “Code” instructions below. Here you'll see “User provided data” at the top of the page, followed by all the pieces of customer data which you can include as part of your enhanced conversion tag.
  7. For the relevant user data field that you'd like to provide via enhanced conversions, click on the dropdown menu and select New Variable.
    Note: If you already have unhashed variables in your data layer (whether using CSS selectors or other variable types), you can select those instead of creating new variables. If you aren’t sure, continue through the instructions.
  8. In the “Variable Configuration” screen, select Choose a variable type to begin setup. In the “Choose Variable Type” screen, select DOM Element.
  9. Back on the “Variable Configuration” screen, change “Selection Method” in the dropdown to “CSS Selector.”
  10. Give your variable a title.
  11. Enter the CSS selector that references your users’ data into the “Element selector” input field (see section below on how to find the CSS Selector). You can leave the “Attribute name” field blank (more on this below).
  12. Click Save for the variable and then save the conversion tracking tag.

Set up manual enhanced conversions with the user-provided data event tag

  1. Sign in to your Google Tag Manager account.
  2. Click Workspace, then click Tags from the navigation menu.
  3. Click New to create a new tag.
  4. Click Tag Configuration and select Google Ads User-Provided Data Event.
  5. Fill in your Google Ads Conversion Tracking ID.
    • Make sure that this conversion action has the same conversion tracking ID and label as the conversion action that you enabled enhanced conversions for in your Google Ads account.
  6. In the dropdown, select New Variable.
  7. Select Manual configuration.
    • You may also select “Code” if you'd like to use Custom Javascript or other data objects to send your data through Google Tag Manager. This method requires data to be formatted in a particular way, so if you’d like to do this, you can read the “Code” instructions below. Here you'll see “User provided data” at the top of the page, followed by all the pieces of customer data which you can include as part of your enhanced conversion tag.
  8. For the relevant user data field that you'd like to provide via enhanced conversions, click on the dropdown menu and select New Variable.
    Note: If you already have unhashed variables in your data layer (whether using CSS selectors or other variable types), you can select those instead of creating new variables. If you aren’t sure, continue through the instructions.
  9. In the “Variable Configuration” screen, select Choose a variable type to begin setup. In the “Choose Variable Type” screen, select DOM Element.
  10. Back on the “Variable Configuration” screen, change “Selection Method” in the dropdown to “CSS Selector.”
  11. Give your variable a title.
  12. Enter the CSS selector that references your users’ data into the “Element selector” input field (see section below on how to find the CSS Selector). You can leave the “Attribute name” field blank. (more on this below).
  13. Click Save.
  14. Click Triggering in the Google Ads User-Provided Data Event Tag. This is where you anticipate that the user data will be available.
  15. Click the plus icon.
  16. Click Trigger Configuration.
  17. Click Form Submission.
    Note: You must select “form submission” for enhanced conversions to work properly.
  18. Select All Forms.
  19. Select Save and then save your new Google Ads User-Provided Data Event tag.

The next step will show you how to copy the CSS Selectors from your conversion page and paste them into these enhanced conversions variables. It’s important you keep this page tab open.

Identify enhanced conversions CSS Selectors and input into Google Tag Manager

To identify the CSS Selectors to input into the enhanced conversion tag fields (for example, email, phone, etc.), follow these steps. If you already have unhashed variables in your data layer, you can select those instead of creating new CSS variables. If you aren’t sure, continue through the instructions:

  1. Navigate back to your website (don’t close your Google Tag Manager page).
  2. Identify the customer data you want to send with enhanced conversions. This data may appear on the conversion page or may appear on another page, such as the form submission page just before the purchase confirmation page. Use your mouse to right-click on top of it and select Inspect.
    • For example, if you are trying to capture an email address, make sure you are right clicking the email address (for example, [email protected])
  3. You will see the Chrome Developer Tools launch within your Chrome browser.
  4. Within the source code presented in the Chrome Developer Tools page, you will see a portion of the code highlighted. This highlighted code is the page element where you need to extract CSS Selectors for the customer data you right-clicked in Step 2 of this section.
  5. Hover your mouse over the highlighted code and right-click it.
  6. Scroll down to "Copy", then select Copy Selector.
  7. In your other tab, with Google Tag Manager open, paste that text in the “Element selector” field.
    • For reference, it should look something similar to but not exactly like this:

      tsf > div:nth-child(2) > div.A8SBwf > div.RNNXgb > div > div.a4bIc > custEmail

  8. Click Save.
  9. Repeat steps 2–8 of this section for each different piece of customer data (for example, email, name and address, etc.), by copying the CSS Selector into a new variable for each customer data variable in Google Tag Manager.
  10. In Google Tag Manager, click Save.

Set up enhanced conversions using “Code” in Google Tag Manager

Identify and define your enhanced conversions variables

First you’ll need to make sure the variables you need like email, address, and phone number are available on the conversion page where the Google Ads conversion tag fires. This will likely be the case on conversion pages for purchases, sign-ups, and other similar conversion types, which often require customer data. If you are unsure which page this is, you should contact your developer.

Once you’ve confirmed that the information is available, you’ll need to store that customer data on your page as global javascript variables, so they can be used by the enhanced conversions tag (which we’ll get to in the next section).

Note: At least one of the following fields must be provided:

  • Email (preferred)
  • Address - First name, last name, postal code, and country are required. You can optionally provide street address, city, and region as additional match keys.
  • A phone number can also be provided as a standalone match key but is recommended to be sent along with an email

You can either send unhashed data, which Google will normalize and hash before the data reaches the servers, or normalized and hashed data. If you decide to normalize and hash the data, follow the below instructions.

For normalization:

  • Remove leading or trailing whitespaces.
  • Convert the text to lowercase.
  • Format phone numbers according to the E.164 standard.

For hash:

The table below lists more information about the customer data variables you can define. You can name the variables however you’d like, and the “Key Name” column indicates how they will be referenced in the enhanced conversions tag (more about that in the next step). Note, all data should be passed as String type variables. Also, when defining name and address, make sure to define each component as an individual variable (for example, first name, last name).

Data Field Key Name Description
Email address email

User email.

Example: ‘[email protected]

sha256_email_address

Hashed user email.

Example:

‘a8af8341993604f29cd4e0e5a5a4b5d48c575436c38b28abbfd7d481f345d5db’

Phone number phone_number

User phone number. Must be in E.164 format, which means it must be 11 to 15 digits including a plus sign (+) prefix and country code with no dashes, parentheses, or spaces.

Example: ‘+11231234567’

sha256_phone_number

Hashed user phone number.

Example:

‘e9d3eef677f9a3b19820f92696be53d646ac4cea500e5f8fd08b00bc6ac773b1’

First name address.first_name

User first name.

Example: 'John'

address.sha256_first_name

Hashed user first name.

Example:

‘96d9632f363564cc3032521409cf22a852f2032eec099ed5967c0d000cec607a’

Surname address.last_name

User last name.

Example: 'Doe'

address.sha256_last_name

Hashed user last name.

Example:

‘799ef92a11af918e3fb741df42934f3b568ed2d93ac1df74f1b8d41a27932a6f’

Street address address.street User street address. Example: '123 New Rd'
City address.city User city name. Example: `Southampton’
Region address.region User province, state, or region. Example: `Hampshire’
Postal code address.postal_code User post code. Example: 'SO99 9XX'
Country address.country User country code. Example: 'UK'. Use 2-letter country codes, per the ISO 3166-1 alpha-2 standard.

The next steps will be to enable enhanced conversions in Google Tag Manager and reference the customer data variables you just created. It may be helpful to keep the names of your customer data variables handy, as you’ll need them in future steps.

Enable enhanced conversions in Google Tag Manager and create custom javascript variable

  1. Sign in to your Google Tag Manager account.
  2. Click Workspace, then click Tags from the navigation menu.
  3. Select the Google Ads conversion tracking tag you’d like to implement enhanced conversions with and edit that tag.
    • If you haven’t set up your Google Ads conversion tracking tag in your Google Tag Manager account, read Google Ads conversions.
    • Make sure this conversion action has the same conversion tracking ID and label as the conversion action you enabled enhanced conversions for in your Google Ads account.
  4. Click Include user-provided data from your website.
  5. Click Select user-provided data variable, then select New Variable.
  6. In the new “User Provided data variable”, select Code at the bottom.
  7. Under “Choose Variable Type,” select Custom Javascript.
  8. Copy the following code into the custom Javascript variable:

    function () {

    return {

    "email": yourEmailVariable , // replace yourEmailVariable with variable name that captures your user’s email

    "phone_number": yourPhoneVariable , // repeat for yourPhoneVariable and following variable names below

    "address": {

    "first_name": yourFirstNameVariable ,

    "last_name": yourLastNameVariable ,

    "street": yourStreetAddressVariable ,

    "city": yourCityVariable ,

    "region": yourRegionVariable ,

    "postal_code": yourPostalCodeVariable ,

    "country": yourCountryVariable

    }

    }

    }

    Code samples for normalized and hashed variables:

    Note: You can also hardcode the field with a string or use a function instead of using variables.
    // Implement
    <script>
    gtag('set', 'user_data', {

    "sha256_email_address": yourNormalizedandHashedEmailVariable,
    "sha256_phone_number": yourNormalizedandHashedPhoneVariable,
    "address": {
    "address.sha256_first_name": yourNormalizedandHashedFirstNameVariable,
    "address.sha256_last_name": yourNormalizedandHashedLastNameVariable,
    "city": yourCityVariable,
    "region": yourRegionVariable,
    "postal_code": yourPostalCodeVariable,
    "country": yourCountryVariable
    }
    });
    </script>

    If you'd like to provide hashed user data values, you can use the following example snippet:

    async function processUserData() {
    const userData = {

    'sha256_email_address': await hashEmail(email.trim()),
    'sha256_phone_number': await hashPhoneNumber(phoneNumber),
    'address': {
    'address.sha256_first_name': await hashName(firstName),
    'address.sha256_last_name': await hashName(lastName),
    'city': city,
    'region': region,
    'postal_code': postalCode,
    'country': country,
    },
    };
    return userData;

    The phone number must be in E.164 format, which means it must be 11 to 15 digits including a plus sign (+) prefix and country code with no dashes, brackets or spaces.

  9. For each type of customer data in the code above, replace the placeholder variables (for example, yourEmailVariable) with the name of the global javascript variable containing that piece of customer data on your conversion page.
    • As a reminder, at least one of the following fields must be provided:
      • Email (preferred)
      • Address (first name, last name, postal code, and country are required)
      • A phone number can also be provided as a standalone match key but is recommended to be sent along with an email.
    • Note that if your site doesn't collect one of those fields, remove the field entirely rather than leaving it blank. For example, a website that only collects emails and phone numbers would create a custom javascript variable that looks like this:

      function () {

      return {

      "email": yourEmailVariable ,

      "phone_number": yourPhoneVariable

      }

      }

  10. Click Save.

You've now set up enhanced conversions for that conversion action. The next step is to validate that it’s working properly. Go to the “Validate your implementation” section below.

Validate your implementation

To verify if your enhanced conversions implementation is working correctly, navigate to your conversion page (you may have to complete a test conversion to do this), and follow these steps. It’s best practice to do this immediately after implementing enhanced conversions so any changes can be made if it's not working properly.

Validate your implementation using Chrome Developer Tools

  1. Right click on your web page.
  2. Select Inspect.
  3. Select the “Network” tab.
  4. Enter “google” in the search bar.
  5. Find the network request that's going to "googleadservices.com/pagead/conversion/" (or "google.com/pagead/1p-conversion/" on some browsers).
  6. Click Payload to view the list of query string parameters.
  7. Look for a parameter “em” with a hashed string as the value. The value should start with “tv.1~em” followed by a long string of characters. If you see the "em" parameter, this means that the enhanced conversions tag is picking up and hashing the enhanced_conversion_data object.
Note: If you see the “em” parameter but you only see “tv.1~em” without a long hashed string following it then you’re sending the enhanced conversions parameter but it’s empty. This may happen if user-provided data isn’t available at the time of conversion.

After 48 hours, review the Diagnostics report to confirm your implementation

About 48 hours after implementing enhanced conversions, you'll be able to view the tag diagnostics report in Google Ads, which you can use to validate that your implementation is working properly. To get there:
  1. In your Google Ads account, click the Goals icon Goals Icon.
  2. Click the Conversions drop down in the section menu, then click Summary.
  3. Click the conversion action that has enhanced conversions enabled.
  4. Select Diagnostics from the page menu at the top. You’ll be able to see your enhanced conversions tag diagnostics report and the metrics for your enhanced conversions in each section.
  5. Review the various health checks to make sure everything is working as expected.
  6. If the tag diagnostics report notifies you that something may be wrong, follow the instructions in the notification and the Help Center to troubleshoot.

Turn off enhanced conversions

 

To turn off enhanced conversions at the account level, follow the steps below:

  1. In your Google Ads account, click the Goals icon Goals Icon.
  2. Click the Conversions drop down in the section menu.
  3. Click Settings.
  4. Expand the “Enhanced conversions for web” panel.
  5. Unselect the checkbox to turn off enhanced conversions.
  6. Click Save.

To turn off enhanced conversions at the conversion action level, follow the steps below:

  1. In your Google Ads account, click the Goals icon Goals Icon.
  2. Click the Conversions drop down in the section menu.
  3. Select the conversion action you want to disable enhanced conversions for.
  4. Click Settings.
  5. Expand the “Enhanced conversions” panel.
  6. Unselect the checkbox next to Enable enhanced conversions.
  7. Click Save.
Note: If you turn off your enhanced conversions you won’t be able to use them for bidding or reporting. However, turning them off will not affect your existing conversion data.

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
7978194137425739910
true
Search Help Center
true
true
true
true
true
73067
false
false
false