Set up enhanced conversions manually with Google Tag Manager (beta)

Enhanced conversions 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.

You can learn more about how enhanced conversions work.

You can set up enhanced conversions with minor or no changes to your tagging configuration, in one of two ways: using Google Tag Manager or the global site tag.

This article will explain how you can set up enhanced conversions manually using Google Tag Manager and common issues with validation and implementation.

Note: If you would like to implement enhanced conversions with the global site tag, read the instructions to set up enhanced conversions manually with the global site tag.

Before you begin

Make sure you have Google Ads conversion tracking set up using Google Tag Manager.

Note: Conversions measured by importing Google Analytics goals are not supported for enhanced conversions. If you would like to use enhanced conversions, consider setting up a new Google Ads conversion action with a global site tag or Google Tag Manager.
  • Know the conversion page URL where the conversion tag fires (e.g. 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 are able to speak with your development team as needed.
  • Make sure you’ve reviewed the enhanced conversions customer data policies and agree to the enhanced conversion terms of service and policies in Google Ads (see steps on this below, under Instructions).

Instructions

  1. Sign in to your Google Ads account.
  2. In the upper right corner of your account, click the tools icon Google Ads | tools [Icon], and under "Measurement," click Conversions.
  3. Open the conversion action you want to use for setting up enhanced conversions.
  4. In the “Enhanced conversions” section at the bottom, click Turn on enhanced conversions.
  5. Review the compliance statement. To enable enhanced conversions you must confirm that you will 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.
  6. Click Check URL to check your website for a Google tag.
  7. In “Tag type” you should be defaulted to Google Tag Manager if that is how you track conversions for this conversion action. Because you used Google Tag Manager to set up website tags, you need to use it to set up enhanced conversions. Follow the instructions below to set up enhanced conversions manually with Google Tag Manager.
  8. Click Save.

Set up enhanced conversion manually using Google Tag Manager

If you currently use Google Tag Manager for conversion tracking, you can implement enhanced conversions with slight changes to your configuration. There are two primary ways in which you can implement enhanced conversions in Google Tag Manager:

  1. Using CSS Selectors - no code changes required on your page
    • This is the easiest way to implement enhanced conversions with Google Tag Manager because this usually requires no code changes on your page as long as you have customer data available on your conversion page (e.g. an email).
    • If you frequently change your website code, in particular the formatting/CSS Selectors on your conversion page, you may want to consider the javascript option below, as changing your website formatting could disrupt the CSS Selector method.
    • Also, if you do not have customer data on your conversion page and need to pass that information from a previous page, the javascript option is better for doing that.
  2. Using javascript variables - minimal code changes (possibly none) required on your page
    • You can implement enhanced conversions using javascript variables on your conversion page as long as the customer data you would like to pass in the enhanced conversions tag (e.g. email, phone numbers, etc.) is defined as global Javascript variables on your conversion page.
    • This method is useful if you prefer to pass the information using javascript variables or if the customer data is not available on the conversion page (e.g. it is available on previous pages and needs to be passed to the conversions page). It is also preferable if you frequently change the formatting on your website, as it’s more resilient to code changes.

Set up enhanced conversion using CSS Selectors in Google Tag Manager

Find enhanced conversions variables on your conversion page

  1. Using the Chrome browser, navigate to your conversion page.
    • The conversion page is the page where the conversion you are trying to measure with enhanced conversions (e.g purchases from Page A) is being tracked using your existing conversion tracking tag. If you are unsure which page this is, you should contact your developer. 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 variables will need to be provided for enhanced conversions to work properly:

      • Email (preferred)
      • Full name and address (first name, last name, street address, city, region, postal code, country - all are required if you choose to use this data)
      • [Optional] A phone number can also be provided along with an email, or full name and address (but not by itself)
  2. Once you have identified the customer data on the page, you will now need to follow the next step to copy the CSS Selectors and enter those into Google Tag Manager 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 tag

In a separate tab, open Google Tag Manager.

  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 Provide enhanced conversion data.
  5. Under Data Source, select “Individual Fields” and then under the “Enhanced conversion variable” dropdown, select New Variable.
  6. Here you will see “Google Ads Enhanced Conversion” 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. (Note: for experienced users who have created variables already, you are able to add other variable types to the Individual Fields values, but for those implementing with CSS Selectors, please continue to Step 7.)
  7. For the relevant user data field that you would like to provide via enhanced conversions, click on the drop down menu and select New Variable.
  8. In the “Choose A Variable” screen, click on the plus “+” sign on the top right of the screen to create a new variable. Do not choose one of the built-in variables.
  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).

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 (e.g. email, phone, etc.), please follow these steps:

  1. Navigate back to your conversion page tab (don’t close your Google Tag Manager page).
  2. On your conversion page, when you have found the corresponding customer data you want to send with enhanced conversions, 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 (e.g. example@email.com) displayed on your conversion page.
  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 choose 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 (e.g. 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.

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

Set up enhanced conversion using Javascript variables 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 variables must be provided:

  • Email (preferred)
  • Full name and address (first name, last name, street address, city, region, postal code, country all required)
  • A phone number can also be provided along with an email, or full name and address.

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, please make sure to define each component as an individual variable (e.g. first name, last name).

Data Field Key Name (in custom javascript variable below) Description
Email address email User email
Phone number phone_number User phone number. The tag will remove symbols and dashes, but the number must contain country code.
First name first_name User first name. Example: “John”
Last name last_name User last name. Example: “Doe”
Street address home_address.street User street address. Example: “123 Main St”
City home_address.city User city name. Example: “San Francisco”
Region home_address.region User province, state, or region. Example: “California” or “CA”
Postal code home_address.postal_code User post code (5-digit version only). Example: “12345”
Country home_address.country User country code. Example: “US”. Use two-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 tag 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 Provide enhanced conversion data.
  5. Under Data Source, select Data Object.
  6. Under “Object Identifier,click the dropdown and select New variable.
    Note: This step could also be done from the Workspace home page, by clicking Variables on the left hand side and creating a new variable that way. If that’s the case when opening the “Object Identifier” dropdown, you could select the variable name you created
  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

    "first_name": yourFirstNameVariable

    "last_name": yourLastNameVariable , "home_address": {

    "street": yourStreetAddressVariable ,

    "city": yourCityVariable ,

    "region": yourRegionVariable ,

    "postal_code": yourPostalCodeVariable ,

    "country": yourCountryVariable

    }

    }

    }

  9. For each type of customer data in the code above, replace the placeholder variables (e.g. 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 variables must be provided:
      • Email (preferred)
      • Full name and address (first name, last name, street address, city, region, postal code, country)
      • Phone number (must be provided in addition to one of the other two pieces of information above)
    • Note, if your site does not 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 have 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

Validate your implementation with Google Tag Manager Preview Mode

Once you have completed the steps above, you can follow these instructions to validate your enhanced conversions implementation within Google Tag Manager. It’s best practice to do this immediately after implementing enhanced conversions so any changes can be made if it is not working properly.

  1. Make sure you have saved your changes, but you do not have to publish them yet.
  2. From the workspace home page, click Preview in the top right corner of Google Tag Manager.
  3. You’ll be asked to input a URL to start test conversion. Enter the URL which will lead to your webpage.
    Note: This does not have to be the actual conversion URL. You’ll be given a chance to navigate from the URL you have provided to the conversion page.
  4. Click Start.
  5. You will see a pop up indicating that “Tag Assistant” is connecting to your webpage. When you see that it says “Connected, click Continue.
  6. Two new tabs will be opened on your browser. One is the URL you entered and the other is the Tag Assistant window. On the tab which is the URL you entered, navigate through your webpage to complete a conversion.
  7. Shift to the Tag Assistant Window tab.
  8. From here you can confirm that the Google conversion tag fired. Check under the “Tags” section to see that your conversion event is listed. Look for the tag with the same name as the tag you set up enhanced conversions for in Google Tag Manager.
  9. To confirm the enhanced conversions variables are processed properly, click that tag.
  10. Move to the “Variables” tab.
  11. Confirm the customer data is correctly passed to Tag. You can review each variable by name (you named the variables in earlier steps directly in Google Tag Manager).
    • If you used the CSS Selector method, you should see a variable for each piece of customer data (for example: email, first name, last name, etc.) with the name equal to what you named the variables in GTM and the equal to type DOM element. You can also review that the values represented in the Value column represent the values you entered when navigating to your conversion page. Your user’s data will be hashed using SHA256 when sent to Google.
    • If you used the javascript variable method you should see one variable of type “Custom Javascript”. This variable should contain an array with each specific piece of customer data listed in this format in the Value column: {email: email@address.com, phone_number: 123456789, etc.}. Your users’ data will be hashed using SHA256 when sent to Google.

After 72 hours, review the tag diagnostics report to confirm your implementation

About 72 hours after implementing enhanced conversions, you will 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. Sign in to your Google Ads account.
  2. In the upper right corner of your account, click the tools icon Google Ads | tools [Icon], and under "Measurement," click Conversions.
  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.

Common issues

If you are unable to validate your enhanced conversions implementation, you should go back through the setup instructions to ensure that all necessary steps were followed. If you’re still having trouble, below is a list of common reasons why you may be encountering issues with your enhanced conversions implementation.

No tag detected

If you see a no tag detected error when trying to initially activate enhanced conversions, you have an error in your website URL or Google tag:
  • Check the spelling of the URL.
  • If you do not have conversion tracking tags in place using the global site tag or Google Tag Manager, you should implement conversion tracking with one of those methods.
  • If you’ve installed a Google tag on your website, you can select one manually and indicate if it uses the Global Site Tag or Google Tag Manager. You may need to troubleshoot your sitewide tagging to ensure you have properly implemented conversion tracking using one of those two methods.

Multiple tags are detected

Choose one of the tags that are listed in the dialog box. If you have a Global site tag AND Google Tag Manager, the “Global site tag” is recommended.

Enhanced conversions data is not available at the time of conversion

In some cases, enhanced conversions data may not be available at the time of conversion, like when that information is collected on another domain (e.g. paying through a third-party domain) or if it is collected elsewhere in the conversion flow (e.g. signed-in customers may not reenter their first-party information, or it may be collected on the previous page).

Pre-hashed data is being provided in your enhanced conversions

We use the SHA256 algorithm to hash the first party data you provide with your enhanced conversions. SHA256 is the industry standard for one-way hashing of data. At this time, enhanced conversions does not support advertisers pre-hashing their data--the Google tags perform this hashing for you.

Variables were not successfully implemented for enhanced conversions

For Google Tag Manager users: review the steps above related to creating variables properly to make sure that you did so correctly. Also ensure that those are the ones referred to when configuring enhanced conversions in Google Tag Manager and that they are populated with data by the time of conversion.

Code copying errors

Double check that all enhanced conversions code on your page and/or variable names entered into Google Tag Manager are correctly. If you implemented enhanced conversions using javascript variables, make sure the custom javascript snippet was copied correctly and then updated to reflect your variable names (and not placeholder information). If you used CSS Selectors, make sure that you selected the correct Selector and properly copied the selector information as described in the steps above.

Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue