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.

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:

  1. Install the Google & YouTube app.
  2. Set up pixels in the app using the instructions from Google.
  3. If you have non-Google tags set up in Google Tag Manager, then replace them by installing alternate apps with app pixels.
  4. Test each app pixel to make sure events are being received by the pixel and they're being received by the third-party platform.
  5. 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:

  1. Confirm if you have the checkout_completed event in your custom pixel code:
    1. In your Shopify admin, go to Settings > Customer events.
    2. Click the Google Tag Manager custom pixel.
    3. In the code, search for the checkout_completed event.
    4. 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.
  2. Add the checkout_completed event to your custom pixel:
    1. 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 the checkout_completed event.
  3. Test the custom pixel to make sure the pixel is loading on your store and receiving events using the Shopify Pixel Helper.
  4. To ensure Google is receiving the events, check the Google product platform. Google Tag Assistant isn't compatible with custom pixels.
  5. 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.
  6. After upgrading, go to Settings > Customer events to test the updated custom pixel and ensure events are firing on the new Thank you page.
Can’t find the answers you’re looking for? We’re here to help.