Set up enhanced conversions for leads with the Google tag

Note: The global site tag (gtag.js) is now the Google tag. With this change, new and existing gtag.js installations will get new capabilities to help you do more, improve data quality, and adopt new features – all without additional code. Learn more About the Google tag.

Enhanced conversions for leads uses first-party user-provided data from your website to measure sales and transactions that happen off your website. If you run lead-generation campaigns to drive offline sales, enhanced conversions for leads can help you understand the impact of your ad spend.

Unlike the current version of offline conversion tracking, this version of offline conversion tracking doesn’t require you to modify your lead forms or customer relations management (CRM) systems to store Google Click ID (GCLID). Instead, it uses user-provided data from your website leads to measure conversions.

This article explains how to use the Google tag to set up enhanced conversions for leads measurement on your website using the Google tag. If you use Google Tag Manager, view set up enhanced conversions for leads using Google Tag Manager. If you want to learn more about the benefits of enhanced conversions for leads and how they work, check out About enhanced conversions.

Note: When enhanced conversions for leads are enabled, the associated global site tag will automatically capture relevant form interaction events on your website.

Before you begin

Before setting up enhanced conversions for leads, you’ll need to identify your website lead forms and pick a field from the form that uniquely identifies your leads. At least one of the following variables must be provided when you configure enhanced conversions for leads on your website and when you later import the conversions:

  • Email (preferred)
  • A phone number

We recommend using the lead's email address because it’s a highly unique identifier and isn’t prone to being reformatted in your CRM. If you're using a phone number, the tag will remove symbols and dashes, but the number must contain a country code.

You'll also need to:

  • Note the URL where the lead form on your website is located. You may need this information during setup.
  • Make sure that auto-tagging is enabled. Auto-tagging is necessary to import offline conversions.
  • Make sure that there is first-party customer data available (email and/or phone number) on your website lead form.
  • Ensure that you have reviewed and confirmed that you can comply with the customer data policies in Google Ads (view steps on this below).

Instructions

Here's an overview of the steps for setting up offline conversion imports using enhanced conversions for leads:

  1. Create a new conversion action
  2. Accept Customer data terms
  3. Configure the Google tag

1. Create a new conversion action

  1. Sign in to your Google Ads account.
  2. Click the tools icon Google Ads | tools [Icon] in the upper right corner of your account.
  3. Under “Measurement”, click Conversions.
  4. Click the plus button icon Add to create a new conversion action.
  5. Select Import in the new “Conversion action” page.
  6. Select Other data sources or CRMs and then Track conversions from clicks. Click Continue.
  7. Enter the settings for this conversion action. For details on the settings, check out Set up offline conversion imports.
  8. Click Create and Continue. The next page will confirm your new conversion action.
  9. Select Enhanced conversions for leads. If you’re using Google Tag Manager, select Enhanced conversions for leads (via Google Tag Manager).
  10. Before you can finish, you’ll need to accept the customer data terms and complete the Google tag configuration.

2. Accept Customer data terms

  1. Next to “Customer data terms”, select View Terms and review the “Policies and Additional Terms for Customer Data”.
  2. Click the “I have read and accept the terms on behalf of my company” checkbox.
  3. Click Save. You’ll see your status updated as “Accepted”.
Note: These terms apply to your entire account or manager account. If you're not able to view the terms, your account conversions are tracked by a manager account. The customer data terms must be accepted from the manager's account and any Google Ads manager account uploading on behalf of the manager account using cross-account tracking.

3. Configure Google tag

  1. Next to “Global site tag configuration”, click Configure.
  2. In the “Details” section, ensure the Google tag is installed on your website.
  3. In the “Configuration” section, ensure you’ve included user data.
Notes:
  • If your transactions are related to sensitive categories, you should use manual configuration to ensure that sensitive data isn’t shared with Google.
  • To measure website leads that convert offline, your tag can include user-provided data with lead form events to simplify the import process. Configure how the user-provided data is included. Google is committed to protecting the confidentiality and security of the data you share with us. Learn more about customer data policies
  1. Click Save. You can see your statuses are updated.
  2. Click Done.

Next, you’ll need to import conversions from ad clicks into Google Ads.

Set up enhanced conversions for leads using Javascript or CSS selectors

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.

Find enhanced conversions fields on your lead form page

  1. Using the Chrome browser in a separate tab from your Google Ads account, navigate to your lead form submission page.
  2. Identify the fields where customer data is entered on the page that you wish to send to Google.

    Note: At least one of the following fields must be provided for enhanced conversions to work properly:

    • An email (preferred)
    • A phone number
  3. Once you’ve identified the customer data fields on the page, you’ll need to follow the next step to copy the CSS Selectors and enter those into Google Ads.

Identify enhanced conversions CSS Selectors and input into Google Ads

  1. On your lead form page, when you've found the corresponding customer data you want to send, use your mouse to right-click on top of it and select Inspect.
    Note: If you're inputting the CSS selector for email in Google Ads, make sure you right click the email address displayed on your lead form 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 and/or phone)
  8. In your Google Ads account, click Save.

Set up enhanced conversions for leads by editing your website code

You can implement enhanced conversions for leads with custom Javascript code to call the Google tag directly (forms hosted by a third-party tool or iFrame may require this) instead of automatic detection or through selectors.

Identify and define your enhanced conversions fields

Ensure your email or phone number are available to your custom code.

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 Javascript snippet, which is created in the next step. Note, that 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.
Note: You’ll need to make sure the customer data is available when the custom code fires. If the user information is collected on a previous page or iframe, you’ll need to make sure it’s available in a variable to your code when it is called.

Implement the enhanced conversions script

Configure and add the following script to where you want the Google tag to fire. Ensure 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,

});

</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 would look like this:

// Implement

<script>

gtag('set', 'user_data', {

"email": {{ yourEmailVariable }}

});

</script>

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]

});

</script>

Related links

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
true
true
true
true
73067
false
false