Replacing Google Tag Manager scripts on the Thank you page
If you currently use a Google Tag Manager script to track behavioral data on your Thank you page, then you need to replace the script and upgrade your Thank you page before the deadline. There are 2 options for replacing your Google Tag Manager script, and you can choose to do whichever option suits your business needs:
- Replace your Google Tag Manager script with the Google & YouTube app. This option is recommended because the Google & YouTube app is maintained by Google, ensuring it stays up-to-date without requiring additional maintenance from you.
- Update your existing Google Tag Manager custom pixel. You should use this option only when you’ve already set up a custom pixel for Google Tag Manager.
On this page
Replace your Google Tag Manager script with the Google & YouTube app (Recommended)
This option is recommended because the Google & YouTube app is maintained by Google, ensuring it stays up to date without requiring additional maintenance from you. If you’ve already set up a custom pixel for Google Tag Manager, then update your existing Google Tag Manager pixel instead.
Learn more about getting set up with the Google & Youtube app.
Steps:
- Install the Google & YouTube app.
- Set up pixels in the app using the instructions from Google.
- If you have non-Google tags set up in Google Tag Manager, then replace them by installing alternate apps with app pixels.
- Test each app pixel to make sure events are being received by the pixel and they're being received by the third-party platform.
- After you confirm that the app pixels are working, deactivate the additional script to avoid sending duplicate events from both the original script and the app pixel.
Update your existing Google Tag Manager custom pixel
You should use this option only when you’ve already set up a custom pixel for Google Tag Manager on your Shopify store.
Steps:
- Confirm if you have the
checkout_completed
event in your custom pixel code:- In your Shopify admin, go to Settings > Customer events.
- Click the Google Tag Manager custom pixel.
- In the code, search for the
checkout_completed
event. - Do either of the following steps:
- If you don't have the
checkout_completed
event in your custom pixel code, then proceed to the next step to add the event to your customer pixel. - If you do have the event in your code, then no action is required and your Google Tag Manager custom pixel will continue to work on the new Thank you and Order status pages.
- If you don't have the
- Add the
checkout_completed
event to your custom pixel:- Follow the instructions to track customer events in your custom pixel code. The
checkout_completed
event is one of Shopify's standard events. Learn more about thecheckout_completed
event.
- Follow the instructions to track customer events in your custom pixel code. The
- Test the custom pixel to make sure the pixel is loading on your store and receiving events using the Shopify Pixel Helper.
- To ensure Google is receiving the events, check the Google product platform. Google Tag Assistant isn't compatible with custom pixels.
- After confirming that the custom pixel is working, deactivate the additional script to avoid sending duplicate events from both the original script and the custom pixel.
- After upgrading, go to Settings > Customer events to test the updated custom pixel and ensure events are firing on the new Thank you page.