Please note that Shopify has announced the deprecation of the Additional Scripts section for integrations, effective August 28, 2025. Instead of using Additional Scripts, it is recommended that you switch to using Shopify's Custom Pixels. It's important to note that all Shopify stores with Custom Pixels have access to Google Tag Manager. This article will guide you through the setup process.
Set up a Custom Pixel for Google Tag Manager
1. In your Google Tag Manager account, click on your Google container ID near the top right of the page to open the installation code snippet.
Example from Shopify’s documentation
2. Copy the code block that belongs in the head section of a page, then navigate back to your Shopify admin and select Settings - Customer events – Add custom pixel
3. Paste the Google Tag Manager code snippet from the previous step into the code editor. Important: Remove all HTML tags from the code block. For example, <script></script>.
4. Next, you will want to add code to subscribe to customer events and push them to GTM’s dataLayer. By default, Shopify offers a set of standard events that can be found here: https://shopify.dev/docs/api/web-pixels-api/standard-events#standard-events
Below is an example of subscribing to the standard “checkout _completed” event, which will push information to GTM whenever a visitor completes a purchase at your store.
analytics.subscribe("checkout_completed", (event) => {
window.dataLayer.push({
event: "checkout_completed",
order_id: event.data.checkout.order.id,
price: event.data.checkout.totalPrice.amount
});
});
Configure Google Tag Manager to accept events
After creating your custom pixel, you'll need to configure Google Tag Manager to receive events from it and then forward them to TUNE. To accomplish this, you will need to set up a tag, a trigger, and dataLayer variables in Google Tag Manager.
1. Set up the Google Tag Manager trigger as a Custom Event with the same event name as your Custom Pixel. In our example, this is "checkout_completed". Set the trigger to fire on All Custom Events.
2. Create GTM variables to capture the data fields from the event. In our example, these are order_id and price. The fields are mapped to a dataLayer variable in Google Tag Manager.
Configure Google Tag Manager to send events to TUNE
Lastly, you need to add a TUNE click tag and a TUNE conversion tag that uses the trigger you just created. You can follow this step-by-step guide to set up your two TUNE tags: https://support.tune.com/hc/en-us/articles/1500008249301-Integrating-with-Google-Tag-Manager
Under event parameters, add the variables that you want to capture. In the example above, order_id and price were set up as dataLayer variables. Each time the tag fires, it will capture these dataLayer variables will be added to the event and sent to TUNE.