Google Ads conversion tracking tags must be able to accurately measure relevant campaign actions (such as clicks, form submissions, product or service purchases, etc.), and for offers to be properly validated based on these accurate data points. This ensures that campaign performance is properly measured and advertising budgets are used efficiently.
Google Ads offers many new features to enrich conversion data. In a previous article titled Shopping Cart Data and Conversion, I discussed how cart data can be considered one of the key performance indicators for campaigns. In this article, I will discuss the advanced conversions feature, which enables optimization of conversion measurement accuracy, thereby enabling more effective offer generation.
Advanced Conversions (Enhanced Conversions)
With Google Ads conversion tracking tags, the Advanced Conversions feature enables optimization of conversion measurement accuracy, allowing for more effective offer generation. This feature is based on the principle that the first-party customer data, hashed using SHA256, is combined with the associated conversion tag. For this process, one or more of the following data fields must be provided:
- Email (recommended)
- Name and shipping/billing address (full address, city, state/province, postal code)
In addition to either of the two pieces of information above, a phone number may also be provided.
For illustration of the mechanism, when a customer completes a defined conversion action (for example, a product purchase), first-party customer data, in addition to the conversion tag, can be associated with that conversion event. If the website where the transaction occurred provides the customer’s (obviously, with the customer’s explicit consent) email address, shipping address, phone number, and other first-party customer data during the conversion process, such information can be sent to Google together with the conversion tag signal (in a hashed form), and can then be used to improve conversion measurement1.
The SHA-256 algorithm, an industry-standard one-way hashing method, is used to apply hashing to first-party data obtained through advanced conversions.
This feature does not support pre-hashing. Hashing is performed by Google tags.
Hashing (Hashing) Algorithm
The hashing function refers to the process of mapping variable-length data sets into fixed-length data sets using an algorithm (for example, SHA-256). This ensures that the data after hashing is secure and protected2.
For instance, various filters are provided for use in areas such as Shopify themes and payment confirmation pages3 4.
{% assign secretString = "secret string" %}
SHA-1: {{ secret String | sha1 }} -> da39a3ee5e6b4b0d3255bfef95601890afd80709
SHA-256: {{ secret String | sha256 }} -> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Google tags also apply one-way hashing to first-party customer data using the SHA-256 algorithm.
Operation of Advanced Conversions
Data converted into hashed form, depending on the type of advanced conversion used, can be utilized in different ways:
| Advanced conversions for websites | Advanced conversions for potential customers |
|---|---|
| Website conversion actions (sales, form submissions, etc.) | Purchases made outside the website (via phone, email, etc.) |
When a conversion is recorded, enriched first-party customer data associated with the customer is linked to the Google account they logged into, enabling improved conversion measurement. Similarly, these data points are also linked to Google Ads campaigns for offline user activities.
Advanced conversions can be included for conversion types where customer data can be linked, such as subscriptions, sign-ups, and purchases. This enables:
- Recovery of conversions that were previously unmeasurable under normal conditions
- Improved offers due to enhanced data quality
Usage of Advanced Conversions
Advanced conversions can be implemented in three ways for websites.
Google Ads
Google Ads provides the ability to link customer data to relevant fields using CSS and JavaScript variables under the relevant conversion tag. However, this method is only effective when the CSS definitions and JavaScript variables remain unchanged and accessible. If these elements are modified or inaccessible, the method will fail.
Therefore, it is essential that the relevant fields are assigned fixed and unique values.
Shopify GA4 and GTM Code Setup article briefly mentioned that customer data was being sent to Google via the Global Site Tag. Let’s now elaborate on this setup method in more detail.
{% if customer.accepts_marketing == true %}
gtag('set', 'user_data', {
'email': '{{ customer.email }}',
'phone_number': '{{ customer.phone }}',
'address': [{
'first_name': '{{ customer.first_name }}',
'last_name': '{{ customer.last_name }}',
'street': '{{ customer.addresses[0].street }}',
'city': '{{ customer.addresses[0].city }}',
'region': '{{ customer.addresses[0].province }}',
'postal_code': '{{ customer.addresses[0].zip }}'
}]
});
{% endif %}
For GTAG usage, the allow_enhanced_conversions parameter must be set to true.
gtag('config', 'AW-CONVERSION_ID', { 'allow_enhanced_conversions': true });
In addition to the Global Site Tag (GTAG), relevant data can also be processed by selecting HTML elements when data is displayed on the page, or by using the Google Tag Manager (GTM). This enables easy access and evaluation of relevant data fields within different tags.
When we enter the advanced conversion section associated with the conversion tag, assuming that the conversion process complies with customer data usage as specified by the relevant conversion tag, we will be asked to select the method we intend to use. Since this article covers GTAG and GTM operations, we must choose the Global site tag or Google Tag Manager option. Then, we will need to define the page URL where the conversion occurs and initiate a brief audit process.
We can create a Google Ads conversion tag for GTM that utilizes the following example data layer:
By selecting Include user-provided data from website, we can link the relevant user data to the corresponding fields. These fields can be linked either as text or as strings. In GTM usage, two different variable formats are employed: Manual configuration and Code.
When selecting the Manual configuration option, all fields can be individually chosen as User-provided Data. However, when selecting the Code option, a Custom JavaScript must be used to capture user data for the relevant action.
function () {
return {
"email": '{{dL - getClientInfo _ clientEmail}}',
"phone_number": '{{dL - getClientInfo _ clientPhone}}',
"address": {
"first_name": '{{dL - getClientInfo _ clientFirstName}}',
"last_name": '{{dL - getClientInfo _ clientLastName}}',
"street": '{{dL - getClientInfo _ clientAddressStreet}}',
"city": '{{dL - getClientInfo _ clientAddressCity}}',
"region": '{{dL - getClientInfo _ clientAddressRegion}}',
"postal_code": '{{dL - getClientInfo _ clientAddressZip}}',
"country": '{{dL - getClientInfo _ clientAddressCountry}}'
}
}
}
The _tag_mode value will also vary depending on the selection between Manual configuration or Code.
After the relevant conversion tag is triggered, data and, of course, user data can also be verified on demand.
Google Ads API
In addition to GTAG and GTM operations, we can also send relevant data to Google via the Google Ads API5. Using the CRM data within conversion tags and leveraging offline activities to improve campaign recommendations, the API will provide a more effective solution. When first-party customer data (leads) collected from potential customer forms is used to send conversions to Google, there is no need to modify potential customer forms or CRM systems to retrieve GCLID (Google Click ID)6 7 data8. Instead, pre-existing data (such as email, etc.) is used for conversion measurement.
Data Fields (Matching Keys)
First, first-party customer data such as email, address, and phone number should be accessible on the same page/screen, linked to the corresponding transformation tag. If these fields are part of a flow, they may be stored in the browser cache in a combined format and made available as needed.
All transmitted data must be treated as string-type variables.
The table below provides additional information about the customer data variables (matching keys) that can be defined.
| Data field | Parameter | Description |
|---|---|---|
| Customer’s email address (in combined format) | ||
| Phone number | phone_number | Customer’s phone number. Digits and special characters (such as symbols and hyphens) should be removed, and the country code must be included (in combined format) |
| First name | address.first_name | Customer’s first name |
| Last name | address.last_name | Customer’s last name |
| Street address | address.street | Street, avenue, building name, and number |
| City | address.city | City |
| Region | address.region | State, province, or region name |
| Postal code | address.postal_code | Postal code |
| Country | address.country | Two-letter country code according to IAO 3166-1 alpha-2 standard |
At least one of the email or address fields must be provided. In addition, the phone number should also be provided. If it is not possible to aggregate any of these fields, it is recommended to completely remove the field instead of leaving it blank.
Advanced Transformation Tag Detection Report
If any advanced transformations are defined for a conversion action, various status details related to the relevant information will be available.
Advanced transformations recorded:
No issues detected and a data flow is currently available.
Advanced transformations unavailable:
The customer data requirements necessary for using advanced transformations have not been accepted9.
Data for advanced transformations is pending:
Sufficient data flow has not yet been established. After enabling advanced transformations, it may take up to 48 hours to establish the data flow and proceed to record the data.
Configuration issues detected
: There is an issue related to the advanced conversion setup10
No new conversion data to process
: If no conversion has been recorded in the last 7 days, the first-party customer data associated with this conversion will also not have been sent. When the relevant customer data is accessible, it is essential to confirm that the conversion tag has been triggered and/or that campaigns are live.
Verification of the Advanced Conversion Tag
During the verification phase of the tag, network activity can be monitored. When entered into the search field as googleadservices.com/pagead/conversion/, the query parameter details related to the conversion signal will be visible within the Payload section.
If customer data has been successfully acquired, it will be listed as a parameter alongside the em parameter. The ec_mode parameter indicates how the customer data was processed. Manual configuration selected will result in the value m, while Code selected will result in the value c. The relevant parameters are separated by ~ within the request.
tv.1~
em.1nZ4hb8syB4LWVNtF-yqGoQZo3kFWcyvdio_A2gJvNw~
fn0.ltljLzY1ZMwwMlIUCc8iqFLyAy7sCZ7VlnwNAAzsYHo~
ln0.eZ75KhGvkY4_t0HfQpNPO1aO0tk6wd908bjUGieTKm8~
sa0.dskjCk814QJxgk4s9I4Ly85pzj_VLf6KDX9foLGKYzY~
ct0.los%20angeles~
pc0.90017~
rg0.california~
co0.US
The values listed above correspond to the following fields as examples:
- em: email
- fn0: first name
- ln0: last name
- sa0: street address
- ct0: city
- pc0: postal code
- rg0: region
- co0: country
Of course, if multiple pieces of data are defined for a customer, those data points can also be sent to Google in a list format. In this case, each entry in the list will be listed in sequence.
The absence of the em parameter in the request indicates that the customer data conversion tag has not been associated. This situation is commonly encountered in GTAG usage. When such an issue occurs, the page re-scan feature within the conversion tag settings must be used to rescan the page, and the relevant data must be re-targeted using either the CSS or JavaScript options.
*[GCLID]: Google Click Identifier
Footnotes
- Manually set advanced conversions for websites using Google Tag Manager. Google Ads Help ↩
- Hashed data: Definition. Google Ads Help ↩
- Liquid sha1: How to Convert String to Sha1 Hash in Shopify ↩
- String filters. Shopify Developers Platform ↩
- Enhanced Conversions. Google Ads API ↩
- Set offline conversions using Google Click ID (GCLID). Google Ads Help ↩
- Google Click ID (GCLID): Definition. Google Ads Help ↩
- Set advanced conversions for potential customers using the Global Site Tag. Google Ads Help ↩
- Customer data policies. Google Ads Help ↩
- About the advanced conversion tag detection report for websites. Google Ads Help ↩