Job template · Tracking and analytics
Job template: move GA4 checkout tracking to a Shopify custom pixel
By The Microployed teamUpdated 2 min read
The short answer
This job moves your GA4 checkout and purchase tracking out of old additional scripts or theme code and into a Shopify custom pixel under Settings > Customer events. The pro maps Shopify's checkout events to GA4 events, removes the old code so purchases aren't counted twice, and proves it works with a test order.
Ready-to-post scope
Move our GA4 checkout and purchase tracking on Shopify to a custom pixel
Typical time for a pro: 1.5 hours to 3 hours
Our GA4 checkout and purchase tracking runs from additional scripts or theme code, and we need it moved to a Shopify custom pixel that loads our Google Tag Manager container. Map Shopify's checkout events to GA4 events, remove the old code so purchases aren't counted twice, and prove it works with a test order. Send a short note on what you changed and where.
Check first
- Your GA4 measurement ID and whether you use Google Tag Manager, and its container ID
- Whether your Thank you and Order status pages are already upgraded
- Any apps that already send GA4 or Google Ads events
- Whether you want GA4 revenue with or without tax and shipping
Access to give
- A staff or collaborator account on your store with access to settings, checkout and themes
- Publish permission on your Google Tag Manager container, added to the pro's own Google account
- Editor access to your GA4 property for the pro's own Google account
- No passwords: the pro works through their own logins
Done when
- The custom pixel shows Connected under Settings > Customer events
- Shopify Pixel Helper shows checkout_started and checkout_completed received during a test order
- The test order appears in GA4 once, with the Shopify order ID and the agreed value and currency
- No old GA4 purchase code remains in the theme or Additional scripts
When you need this job
You need this job when your GA4 purchase tracking depends on code in the checkout's Additional scripts box, in checkout.liquid, or pasted into your theme, and you're moving to Shopify's upgraded Thank you and Order status pages. Shopify's help center (opens in a new tab) says additional scripts for tracking aren't supported on the new pages and recommends replacing them with an app pixel or, where no app fits, a custom pixel. It also warns that once the pages are upgraded, you can't reactivate the old script.
It's also worth posting if GA4 suddenly shows fewer purchases than Shopify after a checkout change, or if you can see the purchase firing twice.
What the pro will do
The pro starts by finding every place GA4 or Google Tag Manager code currently lives, including the theme files, the Additional scripts section of the upgrade guide page and any apps. Shopify's pixel migration guide (opens in a new tab) points out that the same event can be tracked from several places at once, which is the usual cause of double counting.
Next, they add a custom pixel under Settings > Customer events. Shopify's Tag Manager tutorial (opens in a new tab) shows the pattern: the pixel loads your container, subscribes to Shopify events with analytics.subscribe, and pushes them to the data layer, mapping checkout_started to begin_checkout, payment_info_submitted to add_payment_info and checkout_completed to purchase. The pro then sets up matching custom event triggers and GA4 event tags in Tag Manager.
Finally, they remove or disable the old code, connect the pixel, and place a test order.
How to review the work
Ask for a screenshot of the Shopify Pixel Helper during a test checkout. Shopify's testing guide (opens in a new tab) explains that the pixel's Test button opens the helper, and a green dot under Events received means the event fired and its code ran. The pixel's status in Customer events should read Connected.
Then check that the test order appears in GA4 once, with the Shopify order ID as the transaction ID and a value in the right currency. If you see the same order twice, old code is still running somewhere.
Common gotchas
- Tag Assistant looks empty. Shopify notes that Tag Assistant's troubleshooting view isn't compatible with custom pixels, so the pro should test with the Pixel Helper and the browser's network tab instead.
- Revenue doesn't match Shopify. Shopify's checkout_completed event (opens in a new tab) reports a total that includes taxes and duties, while Google's purchase event reference (opens in a new tab) says
valueshould exclude shipping and tax. Decide which figure you want before the work starts. - Purchases missing after an upsell. Shopify says
checkout_completedfires on the first upsell page when you use post-purchase offers, not on the Thank you page. - Nothing fires until consent. If your pixel requires customer permission, events wait for the visitor to accept your cookie banner.
If you're still setting up GA4 purchases from scratch, our GA4 purchase tracking template may be a better fit, and installing Tag Manager on Shopify covers the container itself.
The next level up
Once GA4 purchases come from the pixel, your Google Ads conversions can use the same data
The checkout events your pixel now sends can also feed a Google Ads purchase conversion, so Ads and GA4 count the same orders with the same values. A pro can add the conversion tag in Tag Manager, test it with an order, and confirm it records once.
Post the Google Ads conversion jobQuestions people ask
Do additional scripts still work on Shopify's new Thank you page?
No. Shopify says additional scripts for tracking and analytics aren't supported on the upgraded Thank you and Order status pages, and recommends an app pixel or a custom pixel instead.
Which Shopify event should trigger the GA4 purchase?
Use checkout_completed. Shopify's Tag Manager tutorial maps it to the GA4 purchase event, and it fires once per checkout.
Why can't I see my custom pixel tags in Tag Assistant?
Shopify runs custom pixels in a sandbox, and its help center says Tag Assistant's troubleshooting view isn't compatible with them. Test with the Shopify Pixel Helper instead.
Why is GA4 counting each Shopify order twice?
Usually the old tracking code is still running alongside the new pixel. Check the theme, the Additional scripts section and any apps for a second purchase tag.
Sources
Checked against these pages on .
- Create a Google Tag Manager custom pixel (Shopify Help Center) (opens in a new tab)
- Reviewing and replacing additional scripts on your Thank you and Order status pages (Shopify Help Center) (opens in a new tab)
- Migrating pixels (Shopify Help Center) (opens in a new tab)
- Testing custom pixels (Shopify Help Center) (opens in a new tab)
- Manage your custom pixels (Shopify Help Center) (opens in a new tab)
- checkout_completed (Shopify Web Pixels API) (opens in a new tab)
- Recommended events: purchase (Google Analytics developers) (opens in a new tab)