Set up enhanced conversions for leads with Google Tag Manager

Enhanced conversions for leads is a durable, hybrid measurement solution that deploys a hybrid setup with multiple identifiers (such as the GCLID & PII) through both import and tag. When you upload your leads, the provided hashed information is used to attribute back to the Google Ad campaign.

This article explains how to set up enhanced conversion for leads with Google Tag Manager. If your installation doesn't use Google Tag Manager, review the Google tag instructions.

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.

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

Instructions

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

  1. Configure Google tag settings
  2. Set up enhanced conversions for leads in Google Ads
  3. Accept Customer data terms
  4. Configure Enhanced Conversions for leads in Tag Manager
  5. Verify your setup and publish the container

1. Configure Google tag settings

For enhanced conversions with leads, you’ll need to adjust the Google tag:

  1. Open the Google tag settings.
  2. In the Google tag settings, click Manage automatic event detection. Enable automatic collection for "Form interactions".
  3. Close the menu.

2. Set up enhanced conversions for leads in Google Ads

  1. In your Google Ads account, click the Goals icon Goals Icon.
  2. Click the Conversions drop down in the section menu.
  3. Click Summary.
  4. Click New conversion action.
  5. Select Import in the "New conversion action” page.
  6. Select CRMs, files, or other data sources and then Track conversions from clicks.
  7. In the “Data Source” section, select Connect a new data source.
    1. You can choose to connect data sources via:
      1. Direct connection
      2. Third-party integration by Zapier
  8. Click Continue.
  9. Enter the settings for this conversion action. For details on the settings, check out Set up offline conversion imports.
  10. Click Save and continue. The next page will confirm your new conversion action.
    Note: If you initially skipped connecting data sources, click Set up in the “Set up data sources” section.
  11. Click Done.

3. Accept Customer data terms

When you select Turn on enhanced conversions for leads, you’ll need to accept the customer data terms.

Note: If you aren’t able to view terms, it's because 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.
  1. Select View Terms next to “Customer data terms” and read the “Policies and Additional Terms for Customer Data”.
  2. Click the checkbox beside "I have read and accept the terms on behalf of my company".
  3. Click Agree. You’ll notice your status updated as “Accepted”.

4. Configure Enhanced Conversions for leads in Tag Manager

To measure your enhanced conversions for leads with Tag Manager, you need to do the following:

  • Set up a conversion linker tag.
  • Specify a data source for leads conversions.

If you already have a Conversion Linker tag, you can skip ahead to Specify a data source for leads conversions.

Create a Conversion Linker tag

Conversion linker tags are used to help tags measure click data so that conversions are measured effectively. Deploy a conversion linker tag on any page where visitors may land after they click an ad or promotion.

When people click on your ads, the URL of the conversion page on your website typically includes information about the click. When a site visitor takes an action that you’ve tagged as a conversion (e.g. when a Google Ads conversion tag is fired), the click information is used to associate that conversion with the click that brought the visitors to your site.

The conversion linker tag automatically detects the ad click information in your conversion page URLs, and stores this information in first-party cookies on your domain for web pages, and passes the data in URLs for AMP pages. If you use a conversion linker tag with Google Marketing Platform products, the conversion linker tag may also store unique identifiers in those cookies.

Set up a Conversion Linker tag in Google Tag Manager

To set up a conversion linker tag:

  1. Open Google Tag Manager
  2. Open the container you want to configure.
  3. Click Tags and then New.
  4. Click Tag Configuration and select Conversion Linker.
  5. Select a trigger. In most cases, you should use a trigger that fires on all page views, or on specific page views where site visitors will land after an ad is clicked.
  6. Save and publish your tag configuration.

Instances of conversion linker tags for web and AMP containers will have the additional option to link across domains and web containers will also include the ability to override cookie settings.

Specify a data source for leads conversions

There are 3 ways in which you can implement enhanced conversions in Google Tag Manager. You only need to choose one option to collect user-provided data.

 

Automatic collection

Manual configuration

Code configuration

Collection method

Automatically collects user-provided data based on the code of your website.

If you need control over where to collect inputs, opt for a manual or code setup.

Setup instructions

Specify select CSS properties or JavaScript variables to collect user-provided data.

If you need to take control over data formatting and hashing, opt for code configuration.

Setup instructions

Add a code snippet on your website that sends hashed customer data for matching.

This method is the best choice for maximizing the accuracy of enhanced conversions by letting you send consistently formatted data whenever your conversion tag fires.

Setup instructions

Complexity

Simple

Medium

Complex

Skills

No special skills needed

HTML and CSS

Web development

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

  1. Open Google Tag Manager
  2. In your "Workspace", click Tags from the navigation menu.
  3. Click New to create a new tag and select Google Ads User-Provided Data Event.
  4. In "Tag Configuration":
    • In the field "Conversion ID", supply your Google Ads Conversion Tracking ID.
      • Note: 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.
    • Under "User-provided data", select New Variable.
      1. Create a new "User-Provided Data" variable.
      2. Set the "Type" to "Automatic".
      3. Name the variable.
      4. Click Save.
  5. In “Triggering”, set up should be done when the conversion should be counted:
    1. To add a new trigger, select the + in the upper right corner.
    2. Select a trigger that happens after the form has been filled out. For example, form submissions.
    3. Select All Forms.
    4. Name the trigger.
    5. Click Save.
  6. Name and save your new “Google Ads User-Provided Data Event” tag. Your tag should look similar to this:

    The image shows enhances conversions for leads using automatic collection.

Set up enhanced conversions for leads using "manual configuration" in Google Tag Manager

  1. Open Google Tag Manager
  2. In your “Workspace”, click Tags from the navigation menu.
  3. Click New to create a new tag and select Google Ads User-Provided Data Event.
  4. In “Tag Configuration”:
    • In the field “Conversion ID”, supply your Google Ads Conversion Tracking ID.
      • Note: 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.
    • Under “User-provided data”, select New Variable.
      1. Create a new User-Provided Data variable.
      2. Set the “Type” to “Manual”.
      3. For the relevant user data field that you would like to provide via enhanced conversions, add a new or existing variable.
      • Note: If you already have 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. The variables may be hashed or unhashed.

4. To specify an element from the DOM, create a New Variable > Variable Configuration > DOM Element.
5. Under “Selection Method”, you can either use a “CSS Selector” or “ID”. Learn more about how to find a CSS selector.

  • Tip: If your CSS variables change frequently, add an HTML ID to your site and use the ID variable.

6. Enter the CSS selector or ID name. You can leave the “Attribute name” field blank.
7. Name the DOM Element variable.
8. Click Save. Your screen will then return to the “User-Provided Data” settings.
9. Name the User-Provided Data variable and click Save.

  • The “User-Provided Data” variable settings screen will then close and you’ll be redirected back to the “Google Ads User-provided Data Event” setup.
  1. In “Triggering”, set up should be done when the conversion should be counted:
    1. To add a new trigger, select the + in the upper right corner.
    2. Select a trigger that happens after the form has been filled out. For example, form submissions.
    3. Select All Forms.
    4. Name the trigger.
    5. Click Save.
  2. Name and save your new “Google Ads User-Provided Data Event” tag. Your tag should look similar to this:

    The image shows enhances conversions for leads using manual configuration.

Set up enhanced conversions for leads using the data layer in Google Tag Manager

Step 1: Identify and define your enhanced conversions variables

The data layer is a JavaScript object to pass data safely from your website into Tag Manager. To use the data layer, you need to collect and save data in key-value pairs and use dataLayer.push() to make it available to Tag Manager. In Tag Manager, you can use data layer variables to retrieve the stored data and let your tags use it.

Ensure that collected email or phone numbers are available to your data layer. 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 data layer when it's called.

You can either send unhashed data, which Google will hash before the data reaches the servers, or pre-hashed data. If you decide to send pre-hashed data, please encode the data using hex-encoded SHA256. In either case, provide at least one of the following fields: email or phone_ number.

To push unhashed data to the data layer:

  1. On your website, store user-provided data as key-value pairs in a JavaScript variable. For example:

    var leadsUserData = {

      'email': '[email protected]',

      'phone_number': '+11234567890',

      'address': {

        first_name: 'John',

        last_name: 'Doe',

        street: '123 Lemon',

        city: 'Some city',

        region: 'CA',

        country: 'US',

        postal_code: '12345',

      },

    };

  2. Send the user data together with an event using dataLayer.push(). For example:

    <script>

      dataLayer.push({

        'event': 'formSubmitted',

        'leadsUserData': {

          'email': '[email protected]',

          'phone_number': '+11234567890',

          'address': {

             first_name: 'John',

             last_name: 'Doe',

             street: '123 Lemon',

             city: 'Some city',

             region: 'CA',

             country: 'US',

            postal_code: '12345',

           },

         },

      });

    <script>

The variable leadsUserData is now available in Google Tag Manager.

To push pre-hashed data to the data layer:

  1. On your website, hash user-provided using hex-encoded SHA256. The key for encoded data needs to start with sha256_. For example:

    {'sha256_email_address':await hashEmail(email.trim()),

    }

  2. Send the user data together with an event using dataLayer.push(). The example below shows a data layer implementation that assumes you have written a hashing function yourself, which you run asynchronously.

    <script>

      dataLayer.push({

        'event': 'formSubmitted',

        'leadsUserData': {

          'sha256_email_address': await hashEmail(email.trim()),

          'sha256_phone_number': await hashPhoneNumber(phoneNumber),

          'address': {

            sha265_first_name: await hashString(firstname),

            sha256_last_name: await hashString(lastname),

            sha256_street: await hashString(streetAddress),

            postal_code: '12345',

           },

         },

      });

    <script>

The variable leadsUserData is now available in Google Tag Manager.

Step 2: Enable enhanced conversions for leads in Google Tag Manager and create custom javascript variable

  1. Open Google Tag Manager
  2. In your "Workspace", click Tags from the navigation menu.
  3. Click New to create a new tag and select Google Ads User-Provided Data Event.
  4. In "Tag Configuration":
    • In the field “Conversion ID”, supply your Google Ads Conversion Tracking ID.
      • Note: 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.
    • Under “User-provided data”, select New Variable.
      1. Create a new User-Provided Data variable.
      2. Set the "Type" to "Code".
      3. For the relevant user data field you want to provide, click the dropdown menu and select New Variable.
      4. Under “Choose Variable Type”, select Data Layer Variable.
      5. In the Data Layer Variable, reference your stored user data. For example, leadsUserData.
      6. Click Save.
  5. In “Triggering”, set up should be done when the conversion should be counted:
    1. To add a new trigger, select the + in the upper right corner.
    2. Select a trigger that happens after the form has been filled out. For example, form submissions.
    3. Select All Forms.
    4. Name the trigger.
    5. Click Save.
  6. Name and save your new "Google Ads User-Provided Data Event" tag.

5. Verify your setup and publish your tag

Before you publish your container, make sure that the tag behaves as intended using Preview mode. Additionally, you can also validate user data hashing if you are familiar with networking and hashing algorithms.

Validate your tag setup using Preview mode

To validate your setup with Preview mode, follow these steps:

  1. In your Tag Manager workspace, click the Preview button at the top. A new tab opens with Tag Assistant.
  2. Enter your website’s URL in Tag Assistant. Tag Assistant opens your website and the Tag Assistant summary. Keep both tabs open.
  3. On your website, fill out your form.
  4. Check the "Tag Assistant" summary. Your Google Ads User-Provided Data Event tag should be listed under the "Tags Fired" section in the summary.
    • If your tag is listed under "Tags Not Fired", you need to adjust the tag’s trigger settings.
  5. Click on the tag to see which values were passed to the tag. Check if your input was received. If the tag did not receive any input:
    • Verify your implementation method
    • If another tag fires before the Google Ads User-Provided Data Event tag, edit the "Form Submission" trigger. Set the "Wait for Tags" option.

Validate user data hashing using network calls

To validate that user data is submitted hashed using Google Chrome, follow these steps:

  1. Open your website and navigate to the form field you want to validate.
  2. Open the developer tools.
  3. Open the console settings and check the "Preserve Log" box.
  4. To make validation easier, clear any pre-existing network logs.
  5. With your Network tab in the developer tools open, submit the data to the form field that you want to validate.

What hashed data looks like

Suppose a user entered a raw email address ([email protected]) in the form:

  • If the Google Ads User-Provided Data Event tag received the raw user data, the user data will be hashed by the tag using web-safe Base64 encoded SHA256.
  • If you pre-hash user data before making it available to the Google Ads User-Provided Data Event tag, use Hex encoded SHA256.

Once your tag collects the data you need, Submit your changes in Tag Manager.

Import your conversions into Google Ads

You can import conversion data from the following directly into Google Ads:

Related links

Was this helpful?

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