Set up enhanced conversions for web manually with the Google tag

For subtitles in your language, turn on YouTube captions. Select the settings icon Image of YouTube settings icon at the bottom of the video player, then select "Subtitles/CC" and choose your language.


 

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. You can set up enhanced conversions with minor or no changes to your tagging configuration in one of 2 ways: using Google Tag Manager or the Google tag.

This article will explain how you can set up enhanced conversions manually if you're currently using the Google tag and explains common issues with validation and implementation.

If you'd like to implement enhanced conversions with Google Tag Manager, review Set up enhanced conversions for web manually with Google Tag Manager.

Before you begin

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.
  • 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. 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. In the “Enhanced conversions” section at the bottom, click Turn on enhanced conversions.
  4. 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.
  5. Click Check URL to check your website for the Google tag.
  6. In “Tag type” you should be defaulted to Use Google tag if that's how you track conversions for this conversion action. Because you used your Google tag to set up website tags, you need to use it to set up enhanced conversions.
  7. Select the set up option you want to use:
    • Select Javascript or CSS selectors: Select one or more pieces of customer information (such as Email, Address, and/or Phone) you want to send with enhanced conversions directly in the Ads UI. Keep this tab open since you’ll be inputting details about your customer data directly on this page.
    • Edit code
      • Use Event snippet – add a code snippet on your website that sends hashed customer data for matching.
      • Use enhanced conversion API – set up a direct API integration to Google to send customer data for matching. Learn more about enhanced conversions in the Google Ads API
        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 “Select Javascript or CSS Selectors” and try to send data directly through your enhanced conversions API, that data won't be processed. 
  8. Click Save.
  9. A few days after you set up enhanced conversions you’ll see “Recording conversions (enhanced conversions detected)” in your “Status” column. This means we're currently processing your enhanced conversion data and will notify you once it’s integrated into your conversion action.
Note: After your enhanced conversions are processed, they'll show up in your reporting and your conversion “Status” column will say “Reporting (enhanced conversions)”. That means we have started using enhanced conversion data in the reporting for your conversion action. If you hover the status, you’ll see the date we detected the adoption of enhanced conversions and the impact of reported conversions for this conversion action. We’ll tell you the campaign type and the percentage of reported conversions.

Set up enhanced conversions for web using Javascript or CSS selectors

Find enhanced conversions fields on your conversion page

  1. Using the Chrome browser in a separate tab from your Google Ads account, navigate to your conversion page. If you're unsure which page this is, you should contact your developer.
  2. Identify any customer data that's 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 for enhanced conversions to work properly:

    • Email (preferred).
    • Full name and address (first name, last name, street address, city, region, postal code, country)
    • [Optional] A phone number can also be provided along with an email or full name and address (but not by itself)
  3. 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 Ads so your automatic enhanced conversions knows which pieces of data to hash and send to Google. It’s important you keep this conversion page tab open.

Identify enhanced conversions CSS Selectors and input into Google Ads

First, if you haven’t already, you’ll want to open your Google Ads account to the automatic enhanced conversions page (in one tab). Here’s how to do so if you don’t have it open:

  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. Select the conversion action you want to measure with enhanced conversions, and then expand the “Enhanced conversions” section.
  4. Check the box for each piece of customer data you plan to implement (for example: email, name and address, and others).
  5. Select Javascript or CSS Selector.
    • If you’re using Javascript variables, it’s likely easiest to ask your developer which variables should be added to these fields.
    • If you’re using CSS Selectors, you can follow the steps below.

To identify the CSS Selectors to input into those fields, follow these steps:

  1. On your conversion page, when you've found the corresponding customer data you want to send with automatic enhanced conversions, use your mouse to right-click on top of it and select Inspect.
    • If you're inputting the CSS selector for email in Google Ads, make sure you right click the email address displayed on your conversion page.
  2. You'll see the Chrome Developer Tools launch within your Chrome browser.
  3. Within the source code presented in the Chrome Developer Tools page, a portion of the code will be highlighted. This highlighted code is the portion which includes the CSS Selectors for the customer data you right-clicked in Step 2 of this section.
  4. Hover your mouse over the highlighted code and right-click it.
  5. Scroll down to Copy and then choose Selector.
  6. Paste that text in the Google Ads automatic enhanced conversions section (on your other tab) in the corresponding 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
  7. Complete steps 2-6 of this section for each different customer data type (email, name and address, and so on).
  8. In Google Ads, click Save.

Enhanced conversions is now set up. The next step is to validate that it’s working properly. Go to the “Validate your implementation” section below.

Set up enhanced conversions for web by editing your website code

If you currently have conversion tracking implemented using the Google tag directly on your page (not within a third-party tool or iFrame), you can implement enhanced conversions by making slight changes to your Google tag.

Before implementing, make sure that your Tag Type is noted as Google tag, the implementation method is “Edit Code”, and you've chosen the “use event snippet” button when setting up enhanced conversions for this conversion action.

Identify and define your enhanced conversions fields

Ensure the fields you need like email, address, and phone number are available on the conversion page where the Google Ads event snippet 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're unsure which page this is, you should contact your developer.

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 along with an email or full name and address

The table below lists more information about the fields you can define. The “Key Name” column indicates how they'll be referenced in the enhanced conversions HTML snippet, which is created in the next step. Note, all data should be passed as String types.

Data Field Key Name Description
Email address email User email.
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.
First name address.first_name User first name. Example: “John”
Last name address.last_name User last name. Example: “Doe”
Street address address.street User street address. Example: “123 Main St”
City address.city User city name. Example: “San Francisco”
Region address.region User province, state, or region. Example: “California” or “CA”
Postal code address.postal_code User post code (5-digit version only). Example: “12345”
Country address.country User country code. Example: “US”. Use 2-letter country codes, per the ISO 3166-1 alpha-2 standard.
Note: You’ll need to make sure the customer data is available when the conversion tag fires. If the user information is collected on a previous page, you’ll need to make sure it’s available in your code on the conversion page to configure it in this script.

Implement the enhanced conversions script

Configure and add the following script on your conversion page where the Google Ads event snippet is installed. Ensure that you update variable names below to match the variable names for those attributes on your web page.

For example, if you store email in a variable named “email_address” then the snippet should be edited to reflect that (for example, where it says yourEmailVariable)

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

"email": yourEmailVariable, ***Change yourEmailVariable to the actual Javascript variable name where you are storing the user’s email data. Do the same for the other variables below. Make sure the values aren't hashed.

"phone_number": yourPhoneVariable,

"address": {

"first_name": yourFirstNameVariable,

"last_name": yourLastNameVariable,

"street": yourStreetAddressVariable,

"city":yourCityVariable,

"region": yourRegionVariable,

"postal_code": yourPostalCodeVariable,

"country": yourCountryVariable

}

});

</script>

  • 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, parentheses, or spaces.
  • If your site doesn't collect one of the above fields, remove the field entirely rather than leaving it blank. For example, a website that only collects emails and phone numbers would look like this:
// Implement
<script>
gtag('set', 'user_data', {

"email": {{ yourEmailVariable }},
"phone_number": {{ yourPhoneVariable }}
});
</script>

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

  • Email (preferred)
  • Address - For address, first name, last name, postal code, and country are required. You can optionally provide street address, city, and region as additional match keys.
  • Phone number (must be provided in conjunction with email, or full name and address)

Multiple values

Developers can optionally provide multiple values (up to 3 for phone and email and 2 for address) by using an array value rather than a string. If you capture more than one value, providing this will increase the likelihood of a match. Check the example below:

<script>
gtag('set', 'user_data', {

"email": [yourEmailVariable1, yourEmailVariable2],
"phone_number": [yourPhoneVariable1, yourPhoneVariable2],
"address": [
{first_name: yourFirstNameVariable,last_name: yourLastNameVariable, street: yourStreetAddressVariable, city: yourCityVariable, region: yourRegionVariable, postal_code: yourPostalCodeVariable},
{first_name: yourFirstNameVariable,last_name: yourLastNameVariable,
street: yourStreet AddressVariable, city: yourCityVariable2, region: yourRegionVariable2, postal_code: yourPostalCodeVariable2}
]
});
</script>
Configure your conversion page Google tag
  • Add “{'allow_enhanced_conversions': true}” to the config line to your Google tag that triggers across all pages.
gtag('config', 'TAG_ID', { ' allow_enhanced_conversions':true } ) ;
  • Before: Example of the Google tag (currently in-place):
<!-- Google tag (gtag.js) - Google Ads: 123456 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'TAG_ID');
</script>
  • After:
<!-- Google tag (gtag.js) - Google Ads: 123456 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=TAG_ID"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config','TAG_ID', {'allow_enhanced_conversions':true});
</script>

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 your conversion ID or conversion label into 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. In the Headers part of the Network request, scroll to “Query String Parameters”. Here, you should find that there is a parameter “em” with a hashed string as the value. If you see the "em" parameter, this means that the enhanced conversions tag is correctly picking up and hashing the enhanced_conversion_data object.

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

About 72 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. 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're 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 don't have conversion tracking tags in place using the Google 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 Google tag or Google Tag Manager. You may need to Troubleshoot your sitewide tagging to ensure you've properly implemented conversion tracking using one of those 2 methods.

Multiple tags are detected

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

Enhanced conversions data isn't available at the time of conversion

Enhanced conversions data may not be available at the time of conversion. Instances of this include:
  • When that information is collected on another domain (such as paying through a third-party domain)
  • If it’s collected elsewhere in the conversion (for example, 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, which is the industry standard for one-way hashing of data. At this time, enhanced conversions doesn't support pre-hashed data.

The enhanced conversions parameter (allow_enhanced_conversions) isn't configured to be true within the Google site tag

If enhanced conversions isn't declared in the tag configuration as true, then the implementation won't work. Review the Configure your conversion page Google tag step above for more information.

Variables weren't successfully implemented for enhanced conversions

For the Google tag users, make sure that you've passed the necessary first-party data into global Javascript variables on the page where the conversion tag is firing. It may be necessary to retrieve information entered from a previous page.

Code snippet copying errors

Make sure when implementing the enhanced conversions code that it was copied correctly and then updated to reflect your variable names (and not placeholder information).
Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue

Search
Clear search
Close search
Google apps
Main menu
Search Help Center
false
false
true
true
73067
false
false