Setting Up New Google Purchase Event on Shopify Skip to content

Setting Up New Google Purchase Event on Shopify

Table of Contents

Table of Contents

Tracking conversions is essential for running Google Ads for your Shopify store because it allows you to measure how effectively your ads generate sales or leads. By monitoring conversion data, you can optimize your campaigns by adjusting bids, ad copy, and targeting based on what drives the most conversions.

You should consider adding a custom purchase event to your Shopify store when you want to gain deeper insights into customer behavior and improve your marketing strategies.

So, in this blog post, we’ll cover how you can create a purchase event in your Google Ads account, and how to set it up on your Shopify.

Google Ads Conversion Tracking

Google Ads conversion tracking allows advertisers to measure the effectiveness of their advertising campaigns by tracking specific actions users take after interacting with their ads. These actions, known as conversions, can include purchases, sign-ups, downloads, or any other valuable actions that contribute to your business goals.

For eCommerce stores, the most crucial conversion is the purchase, making it essential to have accurate data. If the tracking code is not implemented correctly, it can lead to errors and double counting.

Let’s explore how to properly implement the purchase event on your Shopify store.

Setting Purchase Event in Google Ads

First things first, let’s create a purchase event in Google Ads.

To create a purchase event in Google Ads, follow these steps:

First, you’ll need to go to your Google Ads Account. From the dashboard, navigate to the “Summary” section and click on Create Conversion Action.

create conversion action in google ads

Once you’re on the conversion setup page, select the option to Start Tracking Conversions and choose Website as the source.

start tracking website conversions

Then, input the URL of your website and click Scan to allow Google to check your site.

enter website for conversion tracking

Select the option to Add Conversion Action Manually Using Code, which allows you to implement the purchase event using tracking code.

add conversion action manually

For the goal of the conversion, choose Purchase to track completed sales as the primary action.

goal and action optimization

Select Use Different Values for Each Conversion if you want to track varying purchase amounts based on product prices.

conversion value

Choose Count Every Click to track every conversion, which is ideal for tracking all individual purchases.

count every conversion

Click Save and Continue to finalize the setup. You’ve now successfully created a custom purchase event in Google Ads.

Following these steps will allow you to track purchase conversions accurately, helping you optimize your campaigns for sales.

Connecting Purchase Event With Shopify Store

Now that you’ve created a custom event in your Google Ads account, the next step is to add the code to your Shopify store.

We’ve also covered this in the video, so if you prefer watching instead, feel free to check it out!

Start by copying the Google Ads purchase event tracking code. To find it, go to Conversions in your Google Ads dashboard, then navigate to Summary. Click on the Purchase event and select Tag Setup.

Purchase event tag setup
install tag manually

From there, choose the option to Install the Tag Yourself. You’ll then see the Google tag code and the event snippet, which you need to copy and paste into your Shopify store.

google tag code
event snippet code

Now that you know where the Google Tag code and Event snippet are, let’s paste them into your Shopify store.

The first step is to create a custom pixel for your Shopify store. To do so, go to Settings > Customer events

create custom events in shopify settings
add custom event for shopify store

For Customer privacy select:

  1. Not required, and
  2. Data collected does not qualify as data sale.
customer privacy settings

Next, paste this code into the code section. 

NOTE: Change the conversion label and AW with your code that you can find at Google Ads Snippet Event.

					//gtag starts here
const script = document.createElement(‘script’);
script.setAttribute(‘src’, ‘https://www.googletagmanager.com/gtag/js?id=AW-111111111’);
script.setAttribute(‘async’, ‘’);
document.head.appendChild(script);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());
gtag(‘config’, ‘AW-111111111’);
//gtag ends here
//ec + purchase code starts here
analytics.subscribe(“checkout_completed”, (event) => {
  gtag(‘set’, ‘user_data’, {
    “email”: event.data.checkout.email,
    “phone_number”: event.data.checkout.phone
  });
  gtag(‘event’, ‘conversion’, {
    ‘send_to’: ‘AW-111111111/1niABCmB9rYDEABf_PMB’,
    ‘value’: event.data.checkout.totalPrice.amount,
    ‘transaction_id’: event.data.checkout.order.id,
    ‘currency’: event.data.checkout.currencyCode
  });
});
				
save google purchase event in shopify

After that, you only need to click on Save and Connect.

Now that you created the Custom event on your Shopify, there is one more step you need to take. 

Go to your Theme and click on Customize. From there you’ll need to click on Edit code.

edit shopify code

When you select </>theme.liquid option you can paste your Google tag code that we created in the Google Ads dashboard.

Paste it in between the <head></head> tags of every page of your website. You only need to install the Google tag once per account, even if you are tracking multiple actions.
 
edit theme liquid in shopify code
paste google tag code into shopify theme

Summing Up

This is the correct way to set up a purchase event in Google Ads for your Shopify store. Implementing it properly ensures accurate tracking of sales data, allowing you to make informed decisions based on real insights. 

With the right setup, you can optimize your ad campaigns, reduce wasted ad spend, and focus on the strategies that drive the most conversions.

Additionally, tracking purchase events enables better performance analysis, helps with remarketing, and improves overall return on investment. 

100+ five-star reviews on Shopify App Store

Recommended Posts

bfcm 2024 cover

How to Prepare Your Store for BFCM 2024

Get your store ready for this holiday season on time! Discover our top tips & tricks for crushing this Black Friday & Cyber Monday.
Read More
black friday facebook ads cover

Best of Black Friday Facebook Ads

Optimize your Black Friday Facebook ads with key strategies to lower customer acquisition costs and boost revenue. Discover how to create compelling offers and target the right audiences.
Read More
tiktok for business marketing cover

Tips on How use TikTok for Business Marketing

Explore the benefits of using TikTok for business marketing and find out some tips on how to use TikTok effectively.
Read More