Logo

Google Ads Direct Integration with Shopify

How directly integrate Shopify with Google Ads in case GA4's integration isn't working.

·3 minutes reading
Cover Image for Google Ads Direct Integration with Shopify

We’ve recently heard that the integration between GA4 and Google Ads may be underreporting conversions when Google Ads. Although the cause of these problems is not yet fully understood, it appears to be related to the integration between the two platforms. To address this issue and provide a backup option for tracking Google Ads conversions on Shopify stores, we provide the code below to integrate Shopify directly with Google Ads, instead of relying on Google Analytics.

Note this will work for most stores but is not fully tested.

Get all the GA4 e-commerce reports you need in under a minute, directly from the Shopify admin for just $10 a month.

The Code To Add to Your Checkout Settings

{% if first_time_accessed %}
<script>
	gtag('event', 'conversion', { 'send_to': 'AW-CONVERSION_ID/CONVERSION_LABEL', 'value': {{ total_price | money_without_currency }}, 'currency': '{{ currency }}', 'transaction_id': '{{ order_number }}' });
</script>
{% endif %}

Creating a Google Ads Conversion Action

To establish a direct integration between Google Ads and your website, bypassing Google Analytics, follow these steps:

  1. Access your Google Ads account and navigate to "Tools" and then "Conversions."
  2. Create a new conversion action by selecting "Conversion actions."
  3. Since we're creating a manual conversion, you can enter any domain and proceed.
  4. Now, manually create a purchase conversion action by selecting "Purchase" from the dropdown menu.
  5. Set a value for each conversion, choose your currency, and decide whether to count every conversion.
  6. You can select your preferred attribution models, with data-driven being recommended.
  7. Skip enhanced conversions for this quick setup.
  8. Click "Save and continue" to proceed.

Adding the Conversion Code to Shopify

To incorporate the conversion tracking code into your Shopify store, follow these steps:

  1. Access your Shopify admin and click on "Settings."
  2. Go to the "Checkout" section and scroll down to find "Checkout additional scripts."
  3. Note that this method may not work ideally with post-purchase conversions.
  4. If you already have existing scripts, do not overwrite them.
  5. Add the provided code underneath the existing scripts, ensuring it is placed after them.
  6. This code prevents duplication by checking if it is the first access.
  7. Make sure to replace the placeholder values in the code with your conversion ID and conversion label obtained from Google Ads.
  8. The rest of the code will automatically populate your total price, currency, and order number from Shopify.
  9. After adding the code, save your changes.

Conclusion

While issues persist with the Google Analytics 4 and Google Ads integration, this workaround provides a reliable backup option for tracking conversions on your Shopify store. By establishing a direct integration between Google Ads and your website, you can ensure accurate data flow without relying solely on Google Analytics. Stay tuned for updates as more information becomes available. We hope you find this workaround helpful. If you'd like to see more videos like this, consider subscribing to our YouTube channel. Additionally, check out our app, Slide Rule Analytics, designed specifically for Shopify stores, and our "Intro to Google Analytics 4 for Shopify Stores" course available on our website.