Google Ads Remarking: Purchase Event Tracking on Shopify using Google Tag Manager
by ShahzadaAliHassan - 5th February 2024
Introduction
Setting up Google Tag Manager (GTM) for Google Ads conversion tracking is crucial for understanding user interactions and optimizing ad campaigns. This comprehensive guide walks you through configuring GTM for dynamic Google Ads conversion tracking on a Shopify store. We will cover the following steps:
- Adding GTM to your Shopify store.
- Setting up Google Ads conversion actions.
- Configuring GTM to fire the conversion tracking tag.
- Testing and verifying the setup.
Step 1: Adding GTM to Your Shopify Store
1.1. Adding GTM to the Theme Files
First, you need to add the GTM container snippet to your Shopify store’s theme files.
- Go to your Google Tag Manager account and copy the container code.
- In your Shopify admin, navigate to Online Store > Themes.
- Click on Actions > Edit Code.
- In the theme.liquid file, paste the GTM container code right after the opening
<head>
tag. - Similarly, paste the GTM container code for the body section right after the opening
<body>
tag. - Save the changes.
1.2. Adding GTM to the Checkout Page
To ensure GTM is active on the checkout and order confirmation pages, follow these steps:
- In your Shopify admin, go to Settings > Checkout.
- Scroll down to the Order Status Page section.
- Paste the GTM container code into the Additional Scripts section.
- Save the changes.
Step 2: Setting Up Google Ads Conversion Actions
2.1. Creating a Conversion Action
- Go to your Google Ads account.
- Navigate to Tools & Settings > Measurement > Conversions.
- Click on + New Conversion Action.
- Select Website as the conversion source.
- Enter your website URL and click Scan.
- Choose Manual setup for the conversion action.
- Select Purchase as the conversion category.
- Name the conversion action (e.g., "GTM Purchase").
- Choose Use different values for each conversion if you want to track purchase values dynamically.
- Configure other settings as needed and click Create and Continue.
2.2. Capturing Conversion ID and Label
- After creating the conversion action, Google Ads will provide a Conversion ID and Conversion Label.
- Copy these values for use in GTM.
Step 3: Configuring GTM to Fire the Conversion Tracking Tag
3.1. Creating Variables in GTM
- Go to your GTM container.
- Navigate to Variables > User-Defined Variables.
- Create a new Constant Variable for the Conversion ID and name it
GoogleAdsConversionID
. - Create another Constant Variable for the Conversion Label and name it
GoogleAdsConversionLabel
.
3.2. Creating a Data Layer Script
You need a data layer script to push purchase details to GTM. Here’s an example script you can use:
Paste this script into the Additional Scripts section in the Order Status Page settings of Shopify.
3.3. Creating a Trigger in GTM
- In GTM, navigate to Triggers.
- Click New and select Custom Event.
- Name the trigger
PurchaseEventTrigger
. - Set the Event Name to
purchase
. - Save the trigger.
3.4. Creating the Tag in GTM
- In GTM, navigate to Tags.
- Click New and select Tag Configuration > Google Ads Conversion Tracking.
- Enter the Conversion ID and Conversion Label using the variables you created earlier.
- Configure additional parameters such as
transactionId
,transactionTotal
, andtransactionProducts
by creating Data Layer Variables for each. - Set the trigger to
PurchaseEventTrigger
. - Save the tag.
Step 4: Testing and Verifying the Setup
4.1. Preview and Debug in GTM
- In GTM, click on Preview to open the GTM debug window.
- Navigate through your Shopify store, adding products to the cart and completing a purchase.
- On the order confirmation page, ensure that the
purchase
event is firing and that the tag is triggered correctly.
4.2. Verifying in Google Ads
- Go to your Google Ads account.
- Check the Conversions section to see if the test purchase was recorded.
- It may take some time for the conversion to appear, so be patient and check back later.
Conclusion
Configuring GTM for Google Ads conversion tracking on a Shopify store involves several steps, but it ensures accurate tracking of user interactions and conversions. By following this guide, you can set up a robust tracking system that provides valuable insights for optimizing your Google Ads campaigns.
By implementing these steps, you'll have a comprehensive setup for tracking conversions on your Shopify store using Google Tag Manager and Google Ads. This will help you measure the effectiveness of your campaigns and make data-driven decisions to improve your marketing strategies.