Google Ads Enhanced Conversion helps you improve your conversion tracking by sharing more detailed conversion data with Google Ads.
Here, you will get a fully functional solution to set up Google Ads Enhanced Conversions in a few steps.
Before moving on to setting up & optimizing, you are recommended to check out our article on the key benefits of setting up Google Ads Enhanced Conversions.
Key Takeaways:
Are you using an ad blocker? The tutorial contains many images- most image names include “Google Ads” or “Ads”. Ad blockers think that it is an ad and blocks those. So make sure to temporarily disable your ad blocker to properly view the content.
🎉 Bonus Content: Explore the best Shopify Google Ads apps to optimize & improve the quality of your campaigns.
As usual, there are several methods. You can easily do it yourself using the first method. You can choose the 2nd, Google Tag Manager method, if you want a more sophisticated setup. We only covered the Purchase tracking as it is the only place where the related user data (email, phone, address) is available.
You can create or apply a new conversion to your existing one. In this tutorial, I will use an existing Google Ads conversion. However, it will very similar if you want to make a new conversion as well.
Step 1: Go to Google Ads > Tools & Settings > Measurement – Conversions
Step 2: Find your Purchase conversion. The conversion source should be “Website”.
You can not apply Enhanced Conversions into a Google Analytics or GA4-sourced conversion.
Step 3: You should be seeing the “Enhanced Conversions” section right below “Tag setup”.
If you are not seeing that, it means this feature is not available for your Ads account yet.
Click the checkbox. Now we will need to choose our setup method.
I will now share the steps and code blocks you need. You can check this official article if you are not using Shopify or if you want to learn more about it.
To be able to move on with me here, you should have the Global Site Tag (gtag.js) installed on your store. You will need to type your URL and click CHECK URL. If Global Site Tag is not installed on your store, you will only be shown the Google Tag Manager Option. If that’s the case, move to Method 2. Alternatively, you can learn how to install Global Site Tag on Shopify.
As mentioned above, if you have the Global Site Tag installed, you should be seeing something like the one below. Follow the steps:
Choose Global Site Tag > Edit Code > Use Event Snippet – and SAVE.
We will also need to learn your Conversion ID and label. Just scroll up to the “Tag Setup” part and choose Google Tag Manager. We will NOT use Google Tag Manager. We are choosing this just to get your Conversion ID and Label easier. Copy your Google Ads Conversion ID and Label and move to the next step.
Better safe than sorry! Let’s take the backup of your existing codes – just in case.
Go to your Shopify Store Admin > Settings > Checkout > Additional Scripts
Things are quite sensitive here. Copy all of the existing code blocks and save them somewhere safe; you can email yourself 🙂
Take a sip from your coffee. Now the fun part begins! We will add & remove some codes from your Shopify Checkout scripts.
You most probably have a conversion script there. If you can’t see it in the first place, you can try searching “AW-” – and the search should lead you. It should look like this:
If you don’t have it there, there are two possibilities:
a) Your conversion tracking wasn’t already working properly.
In this case, just continue to the next step because our code snippet will already include the conversion tracking script as well.
b) You are using Google Tag Manager to track conversions.
In this case, you can either pause your conversion tag in Google Tag Manager or use the 2nd Method to implement the Enhanced Conversions.
The code block is below. Please read these points carefully before you implement them:
Agreed? Great! Now copy the code block below and go to the next step.
{% comment %}
Analyzify - Enhanced Conversions Tag V1.4
SECTION 1: ONLY EDIT HERE
Add your relevant values here. Detailed guideline: https://analyzify.app/hub/google-ads-enhanced-conversion-setup-on-shopify/
{% endcomment %}
<script>
const analyzify = {
ads_conversion_id: “AW-111111111”,
ads_conversion_label: “conversionlabelhere”,
product_id_format: “product_id-variant_id”, // options: product_id-variant_id, variant_id, sku, product_id
ads_merchant_id: “222222222",
ads_feed_country: “US”,
ads_feed_language: “EN”,
product_id_prefix: “shopify”,
divider: “_”,
user_provided_data: ‘email’, // options: all, email, email-phone
debug: false, // options: true, false
}
</script>
{% comment %}
SECTION 2: DO NOT EDIT BELOW - ONLY EDIT SECTION 1
{% endcomment %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, analyzify.ads_conversion_id, { ‘allow_enhanced_conversions’: true });
</script>
<!-- START Google Ads Enhanced Conversions -->
<script>
const checkOrderPage = {% if first_time_accessed %}true{% else %}false{% endif %} || window.location.href.indexOf(‘thank_you’) > -1 || analyzify.debug;
if (checkOrderPage) {
const userProvidedData = {
email: ‘{{ checkout.email }}‘,
phone: ‘{{ billing_address.phone }}’ !== ‘’ ? ‘{{ billing_address.phone }}’ : ‘{{ shipping_address.phone }}‘,
address: {
first_name: ‘{{ billing_address.first_name }}’ !== ‘’ ? ‘{{ billing_address.first_name }}’ : ‘{{ shipping_address.first_name }}‘,
last_name: ‘{{ billing_address.last_name }}’ !== ‘’ ? ‘{{ billing_address.last_name }}’ : ‘{{ shipping_address.last_name }}‘,
street: ‘{{ billing_address.street }}’ !== ‘’ ? ‘{{ billing_address.street }}’ : ‘{{ shipping_address.street }}‘,
city: ‘{{ billing_address.city }}’ !== ‘’ ? ‘{{ billing_address.city }}’ : ‘{{ shipping_address.city }}‘,
region: ‘{{ billing_address.province_code }}’ !== ‘’ ? ‘{{ billing_address.province_code }}’ : ‘{{ shipping_address.province_code }}‘,
postal_code: ‘{{ billing_address.zip }}’ !== ‘’ ? ‘{{ billing_address.zip }}’ : ‘{{ shipping_address.zip }}‘,
country: ‘{{ billing_address.country_code }}’ !== ‘’ ? ‘{{ billing_address.country_code }}’ : ‘{{ shipping_address.country_code }}’,
},
};
let userData = {};
if (analyzify.user_provided_data === ‘all’) {
userData = userProvidedData;
} else if (analyzify.user_provided_data === ‘email’) {
userData = { email: userProvidedData.email };
} else if (analyzify.user_provided_data === ‘email-phone’) {
userData = { email: userProvidedData.email, phone: userProvidedData.phone };
}
gtag(‘set’, ‘user_data’, userData);
const set_id_format = function(format){
// Set product id format
if (format === ‘product_id-variant_id’) {
return function(item){
return `${analyzify.product_id_prefix}${analyzify.divider}${analyzify.ads_feed_country}${analyzify.divider}${item.product_id}${analyzify.divider}${item.variant_id}`;
}
} else if (format === ‘variant_id’) {
return function(item){
return item.variant_id;
}
} else if (format === ‘sku’) {
return function(item){
return item.sku;
}
} else {
return function(item){
return item.product_id;
}
}
}
gtag(‘event’, ‘purchase’, {
send_to: analyzify.ads_conversion_id + ‘/’ + analyzify.ads_conversion_label,
transaction_id: ‘{{ order.order_number }}’ || ‘{{ checkout.order_id }}’ || ‘{{ order.id }}’,
value: Number(Shopify.checkout.total_price_set.presentment_money.amount),
currency: Shopify.checkout.total_price_set.presentment_money.currency_code,
discount: Shopify.checkout.discount == null ? 0 : Shopify.checkout.discount.amount,
aw_merchant_id: analyzify.ads_merchant_id,
aw_feed_country: analyzify.ads_feed_country,
aw_feed_language: analyzify.ads_feed_language,
items: Shopify.checkout.line_items.map(item => ({
id: set_id_format(analyzify.product_id_format)(item),
quantity: Number(item.quantity),
price: Number(item.line_price),
google_business_vertical: ‘retail’,
})),
});
}
</script>
<!-- END Cart Data -->
{% comment %}
END Analyzify - Enhanced Conversions Tag V1.3 Detailed guideline: https://analyzify.app/hub/google-ads-enhanced-conversion-setup-on-shopify/
{% endcomment %}
Make sure that you have copied it correctly.IMPORTANT:
Once again, ONLY copy; don’t paste it yet.
Before you move on, we have an important note. We keep updating these code blocks with the latest information. Please make sure to visit the related page on our website to make sure that you have the latest code.
The following section of the code is to be updated with your own values/information. DO NOT change any other section in the code.
And here are the details:
Let’s quickly double-check your Google Feed product ID format.
Visit Google Ads and click PRODUCTS on the left menu. You will see the merchant ID as marked below – and your product ID format next to that. On our example it starts with “shopify_AU_…” because the native Google Sales Channel is used for product feed on Shopify.
If you are using a different format here, you should adjust our codes accordingly.
All the other fields are quite easy. Don’t forget to replace:
After you replace all these values – now it is time to use this code.
Visit Shopify Admin > Settings > Checkout > Additional Scripts
And paste the final code there. It should look like this:
We are done. The enhanced conversion data should be coming into Google Ads shortly. As mentioned above:
This is a new feature, and it is still in “beta”. Even though we tested very well and observed great results, it might not perform perfectly for your case.
We are done! If you are curious, here is the reference from Shopify documentation.
This is a more complex setup and it requires your store to have a set of data layers and a correctly structured Google Tag Manager container to make it work. We will add a separate series of tutorials for this.
For now, we recommend you use the method explained above. If you still want to use Google Tag Manager;
It’s a feature that allows you to share more data about your conversions with Google Ads so that the conversion tracking will work better. It works quite similarly to Facebook Conversion API.
On regular Google Ads conversion tracking; the order ID, revenue, and optionally purchased products are being sent. With Google Ads Enhanced Conversion – you can also send customer details such as email, name, address, and phone number. Let’s consider an example:
Google explains:
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. Source
Conversion tracking has become significantly hard after the new changes in the world of data tracking such as iOS 14.5, Safari ITP, and with arise of adblockers. You can’t optimize and measure your advertising spending if you don’t measure them well. So, the answer is yes if you want to count and attribute more conversions.
Note: After activating Google Ads enhanced conversions, don’t forget to import your Shopify customer data into Google Ads.
Setting up Google Ads Enhanced Conversions on Shopify is vital for accurate conversion tracking, especially in the face of recent changes in data tracking. This feature allows you to share comprehensive conversion data, including customer information.
The tutorial offers two methods:
Editing Code Directly: This is a straightforward approach for those comfortable with coding.
Google Tag Manager: A more advanced setup requiring a structured container and data layers.
With Enhanced Conversions, you not only track order details but also capture valuable customer information, enabling more precise attribution of conversions to your advertising efforts.
In a landscape where accurate measurement of advertising ROI is paramount, adopting Google Ads Enhanced Conversions is a vital step toward optimizing your advertising spend.