LW IT Solutions
« Blog Overview /Digital Marketing/Tutorials / Tutorial: Implementing Google Ads Enhanced Conversions
This post in other languages:

Tutorial: Implementing Google Ads Enhanced Conversions

Google Ads Enhanced Conversions significantly improve measurement accuracy by recovering conversions that would otherwise be lost due to cookie restrictions or cross-device journeys. By securely transmitting hashed first-party customer data (such as an email address) to Google, the system can match this data against signed-in Google accounts, attributing the conversion to the correct ad click.

The following tutorial explains the process of capturing an email address after a purchase or lead generation, ensuring it is hashed properly, and sending it via Google Tag Manager (GTM).

Step 1: Enabling the Feature in Google Ads

Before any technical implementation begins, Enhanced Conversions must be enabled within the Google Ads account. This is done by navigating to the Conversions section, selecting the specific conversion action (e.g., Purchase or Lead), and checking the box to turn on Enhanced Conversions. The “Google Tag or Google Tag Manager” method should be selected.

Step 2: Capturing the Email Address

The core of the implementation is extracting the customer’s email address on the “Thank You” page. There are two primary methods to achieve this:

Method A: DataLayer (Recommended)

The most robust and reliable approach is pushing the email address directly into the DataLayer from the server or CMS. A standard DataLayer push upon a successful transaction looks like this:

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  'event': 'purchase',
  'customerData': {
    'email': 'customer@example.com'
  }
});
</script>

In GTM, a Data Layer Variable must be created pointing to the key customerData.email.

Method B: CSS Selectors (Fallback)

If modifying the DataLayer is not possible, the email can be extracted directly from the website’s Document Object Model (DOM). If the email is displayed on the confirmation page (e.g., <span id="customer-email">customer@example.com</span>), a DOM Element Variable can be created in GTM. The selection method should be set to “CSS Selector” with the selector targeting the specific element (e.g., #customer-email).

Step 3: Creating the User-Provided Data Variable

Once the email is captured as a GTM variable, it must be formatted correctly for Google Ads.

  1. A new variable of the type User-Provided Data is created in GTM.
  2. The “Manual configuration” option is selected.
  3. The previously created email variable (from DataLayer or DOM) is assigned to the “Email” field.

Step 4: Hashing and Transmission

Privacy regulations require that personal data is never sent in plain text. A major advantage of using the GTM “User-Provided Data” variable is that it automatically applies the required SHA-256 hashing algorithm to the email address before transmission. No manual JavaScript hashing is required.

Step 5: Attaching to the Conversion Tag

The final step involves linking the configured data to the tracking tag.

  1. The existing Google Ads Conversion Tracking tag is opened.
  2. The box for “Include user-provided data from your website” is checked.
  3. The newly created User-Provided Data variable is selected from the dropdown menu.

The setup must be tested using GTM Preview Mode. When the conversion tag fires, the network request can be inspected to verify that the em (email) parameter is populated with a hashed string, confirming a successful, privacy-compliant implementation.

Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in Touch

Briefly describe your project or inquiry for a tailored response. This site is protected by reCAPTCHA.

Leave a Reply

Your email address will not be published. Required fields are marked *

ALL ARTICLES & CATEGORIES

Data Privacy

Digital Analytics

Digital Marketing

IT & Networks

Raspberry PI

Smart Home

Tutorials

Tutorials

Tutorials

Tutorials

Tutorials

Uncategorized

Web Development

Wordpress Hacks

Home Sitemap