Built for Shopify & WooCommerce · Tracking checked every 30 minutes.

How to set up the Pinterest tag on Shopify with Google Tag Manager (conversion tracking)

Abir Molla
Abir MollaNov 20, 2026 · 12 min read
How to set up the Pinterest tag on Shopify with Google Tag Manager (conversion tracking)Video · 15:40 · plays from YouTube

To set up the Pinterest tag on Shopify with Google Tag Manager, you run Google Tag Manager and a Shopify data layer as a custom pixel under Settings → Customer events, then build one Pinterest tag for each event: the base code, PageVisit, AddToCart, ViewCategory, Search and Checkout. Checkout is Pinterest's name for a completed purchase, and it should carry the order value, currency, order ID, order quantity, the products as line items and an event ID. Add the customer's email for enhanced match, and Pinterest can match more of your sales to the people who saw your ads.

The video above shows the whole build in Google Tag Manager, tag by tag, and the test at the end. This post is the written version: the same tags and variables in order, the values each one needs, and the double-counting trap with Pinterest's own Shopify app.

What changed since the video

I recorded the video in February 2024. In it, the data layer goes into the theme as two snippets through Edit code, the way most stores did it then. That no longer covers the whole store. Shopify's checkout, Thank you and Order status pages don't run your theme code or the checkout's Additional scripts any more, so a data layer pasted into the theme never sees a purchase. Today the data layer and Google Tag Manager go in a custom pixel under Settings → Customer events, and Shopify says to remove old tracking code from theme.liquid and Additional scripts when you move it there (Shopify Help Center, manage custom pixels). The Pinterest tags, variables and triggers in Google Tag Manager are built the same way as in the video. Step 2 below covers the new part.

Why track Pinterest conversions with Google Tag Manager

Pinterest optimises your ads and reports results from the events your store sends. Without a Checkout event with a real value, Pinterest can't tell which ads led to sales. Without product IDs, it can't retarget people with the products they viewed.

Google Tag Manager gives you control over each event: which products it sends, what value, and when it fires. You can test everything in Preview mode before it goes live. And if you add an event ID to every tag now, you're ready for the Pinterest Conversions API later, without counting sales twice.

What you need

  • A Pinterest business account with ads set up. Your tag ID lives on the Conversions page.
  • A Google Tag Manager Web container for your store.
  • A Shopify data layer script. It pushes each store event (product viewed, added to cart, collection viewed, search, purchase) with the product, order and customer details. In the video I use a premium data layer; any good one works, but the variable names below depend on it.
  • Admin access to your Shopify store, to add a custom pixel.

The events this setup sends, from Pinterest's list of event codes (Pinterest Developers, Pinterest tag):

  • Base code on every page. It loads the tag and carries the email for enhanced match.
  • PageVisit when someone views a page. On product pages it also carries the product.
  • AddToCart when someone adds a product to the cart.
  • ViewCategory when someone views a collection.
  • Search when someone searches your store.
  • Checkout when an order is completed. This is the purchase, and the event that matters most.

Before you start: check the Pinterest app for Shopify

Pinterest's own Shopify app installs the Pinterest tag and the Conversions API for you. Pinterest recommends removing a tag you added by hand, or through another app, before you use it (Pinterest Help, Shopify and the Pinterest tag).

The reverse is just as true. If the app already sends events to your tag and you add Google Tag Manager tags on top, every page visit, add to cart and checkout reaches Pinterest twice, with different event IDs. Pinterest can't tell they're the same, and your sales look doubled.

Pick one source of Pinterest events: the app or your Google Tag Manager setup. If you keep the app for your catalog, check what tracking it still sends before you build anything here.

Step 1: find your Pinterest tag ID

In Pinterest, open the menu and go to Conversions. If you haven't installed a tag yet, choose to install the Pinterest tag and pick Google Tag Manager as the method. Pinterest shows your tag ID. Copy it; every tag in Google Tag Manager needs it.

If you already have a tag, for example from an old setup, use that one. Don't make a second tag for the same store.

Step 2: add the data layer and Google Tag Manager as a custom pixel

This is the step that changed. In your Shopify admin, go to Settings → Customer events and click Add custom pixel. Name it, for example "GTM data layer", and click Add pixel.

Set the Customer privacy options to fit your store. If you sell to the EU or UK, let your consent banner decide when the pixel runs.

Clear the placeholder code, paste your data layer script, and put your own Google Tag Manager container ID (it starts with GTM-) where the script asks for it. Click Save, then Connect. A saved pixel doesn't track anything until it's connected (Shopify Help Center, manage custom pixels).

If you followed the video before, remove the data layer snippets and their {% render %} lines from your theme, and any Google Tag Manager code you pasted into theme.liquid. Otherwise you have two copies of the same container running.

One difference from the video matters later. Google Tag Manager now runs inside Shopify's pixel sandbox, so it can't read text from the page itself. Everything your tags send has to come from the data layer.

Step 3: create the variables

In Google Tag Manager, go to Variables → New. Build these first, because the tags use them:

  • Pinterest tag ID. A Constant variable with your tag ID, so you change it in one place.
  • Email. A Data Layer Variable for the customer's email. It's usually only known at checkout.
  • Event ID. A Data Layer Variable for the event ID your data layer pushes with each event. If yours doesn't push one, use a variable that makes a unique ID per event.
  • Currency, order value and order ID. One Data Layer Variable each. Use the real order total from the data layer, never a fixed number.
  • Items. A Data Layer Variable for the products array, for example ecommerce.items. The video's data layer uses a different array for each event (product view, cart, collection, purchase), so you may need one per event.

Pinterest wants products as line_items, with its own field names (Pinterest Developers, Pinterest tag). The video turns the data layer's products into line items with a Custom JavaScript variable. Here's the same idea for a data layer that sends GA4-style items:

function() {
  var items = {{DLV - ecommerce.items}} || [];
  return items.map(function(item) {
    return {
      product_id: String(item.item_id),
      product_name: item.item_name,
      product_price: Number(item.price),
      product_quantity: Number(item.quantity || 1),
      product_category: item.item_category,
      product_brand: item.item_brand
    };
  });
}

Change the variable name and the field names to match your data layer. The product_id should be the same ID your Pinterest catalog uses, or Pinterest can't connect a sale to a product.

Checkout also needs order_quantity, the number of items in the order. The video uses a second Custom JavaScript variable for it:

function() {
  var items = {{DLV - ecommerce.items}} || [];
  return items.reduce(function(total, item) {
    return total + Number(item.quantity || 1);
  }, 0);
}

Step 4: create the base code tag with enhanced match

Go to Tags → New, open Tag Configuration and search for Pinterest. Choose the Pinterest tag template.

  • Tag ID: your tag ID constant.
  • Email (enhanced match): your email variable.
  • Event: base code only.
  • Trigger: all pages.

Enhanced match sends the shopper's email so Pinterest can match a sale even without a Pinterest cookie in the browser. Pinterest says its JavaScript tag hashes a plain email with SHA-256 in the browser before sending it, and you may also pass one that's already hashed (Pinterest Developers, Pinterest tag). An empty email on most page loads is normal; it fills in when the shopper reaches checkout.

Step 5: create the PageVisit tags

The video uses two PageVisit tags, so product pages carry the product and other pages don't.

PageVisit on normal pages. Same tag ID and email, event PageVisit, plus a custom parameter event_id set to your event ID variable. Fire it on the page view event your data layer pushes, with an exception trigger for product pages. In the video, the exception is a Custom Event trigger with the event name .* (with Use regex matching on) that fires only when Page Path contains products.

PageVisit on product pages. Event PageVisit, with custom parameters line_items (your product view line items variable), currency and event_id. Fire it on your data layer's product view event, for example view_item.

The trigger's event name must match what your data layer pushes, letter for letter. Check the exact names in Preview mode.

Step 6: create the AddToCart tag

Event AddToCart. Fill in the order value fields: value from your cart value variable, currency, and order quantity. Then add the custom parameters line_items (your cart line items variable) and event_id.

Trigger it on your data layer's add to cart event, for example add_to_cart.

Step 7: create the ViewCategory and Search tags

ViewCategory takes three custom parameters: the category name, line_items for the products shown, and event_id. In the video I read the category name from the page with a DOM Element variable. That doesn't work inside Shopify's pixel sandbox, so take the collection name from the data layer instead. Trigger it on your collection view event.

Search takes event_id and, if your data layer sends them, line_items for the results. Trigger it on your search event.

These two are optional, but they help Pinterest build audiences of people who browsed a category or searched for something.

Step 8: create the Checkout tag

This is the purchase. Pinterest calls it Checkout and uses it for conversion reporting.

  • Event: Checkout.
  • Value: your order value variable.
  • Currency: your currency variable.
  • Order quantity: your order quantity variable.
  • Order ID: your Shopify order ID variable. Pinterest uses it in conversion reporting (Pinterest Developers, Pinterest tag).
  • Custom parameters: line_items (your purchase line items variable) and event_id.
  • Email: your email variable, for enhanced match.
  • Trigger: your data layer's purchase event, for example purchase.

You don't need to send product IDs or categories as separate fields. They travel inside line_items.

Pinterest also lists InitiateCheckout and AddPaymentInfo events. You can add them the same way if you want to see the steps between cart and purchase.

Step 9: publish and test

Click Submit, name the version, for example "Pinterest tag v1", and Publish. Then open Preview, connect to your store and place a test order: view a collection, open a product, add it to the cart, search, and complete checkout.

In the Preview panel, click each event and open Tags Fired. On the purchase event, click the Pinterest Checkout tag and check what it sent: value, currency, order ID, order quantity, the line items with product names and IDs, the event ID and the email.

Then check on Pinterest's side. Pinterest describes two ways to verify the tag (Pinterest Help, verify the Pinterest tag):

  • Pinterest Tag Helper. A Chrome extension that shows the events on the page and the data each one carried. It also warns when the enhanced match email is missing or malformed. Because Google Tag Manager now runs in Shopify's sandbox, the extension may not see every event; Preview mode and Test events are the checks to trust.
  • Test events. In Pinterest, go to Conversions → Test events, enter your store's address and click Launch. Go through the store in the tab that opens, then come back. Each event you triggered shows up, and you can click it to see its data.

After a few orders, the Conversions page shows how many of each event Pinterest received. In the video, page visits, add to cart, search and checkout all show up there.

Next step: the Pinterest Conversions API

Everything here runs in the shopper's browser, so ad blockers and browser privacy rules still stop some events. The Pinterest Conversions API sends the same events from a server. Pinterest uses the event ID to remove the duplicate when it gets the same event from the tag and the API, which is why every tag in this setup carries one.

Common mistakes

The Pinterest app and Google Tag Manager both send events. Two sources mean two copies of each event with different IDs. Keep one.

The data layer is still in the theme. It won't see the Thank you page, so the Checkout tag never fires. Move it to a custom pixel and remove the theme snippets.

The custom pixel was saved but not connected. It tracks nothing until you click Connect.

Checkout fires on the start of checkout. In Pinterest, Checkout means a completed order. Fire it on the purchase event only.

A fixed or missing value on Checkout. The value and currency must come from the data layer, so each order reports its real total.

Product IDs that don't match the catalog. If product_id in your line items isn't the ID your Pinterest catalog uses, Pinterest can't tie sales or retargeting to products.

No event ID. The tag works without it, but when you add the Conversions API, Pinterest can't tell browser and server events apart, and sales get counted twice.

Questions people ask

Can I add the Pinterest tag to Shopify without an app?

Yes. That's what this setup does. Google Tag Manager runs as a custom pixel under Settings → Customer events, and the Pinterest tags live in Google Tag Manager. No app or theme code is needed.

Should I use the Pinterest app for Shopify or Google Tag Manager?

Either works, but not both for the same tag. The app is quicker and also sets up the Conversions API. Google Tag Manager gives you control over each event and what it sends.

What's the difference between PageVisit and Checkout?

PageVisit tracks views of key pages, such as product pages. Checkout tracks a completed purchase. Only Checkout should carry the order value and order ID.

Does enhanced match send customers' emails to Pinterest in plain text?

No. Pinterest says its JavaScript tag hashes the email with SHA-256 in the browser before it's sent.

Why don't I see my events in Pinterest Tag Helper?

With Google Tag Manager running in Shopify's pixel sandbox, the extension may not pick up every event. Check Google Tag Manager Preview mode and Pinterest's Test events instead.

Where KiteTrack fits

KiteTrack takes this setup to the server. It runs your own tracking server on your store's subdomain and sends your Shopify checkouts, carts and page visits to Pinterest through the Conversions API, next to the tag, with one event ID so each sale counts once. The same server sends to Meta, Google Ads, GA4 and TikTok, customer details are hashed before they leave it, and your tracking is checked every 30 minutes, so a broken event becomes an alert. Pinterest is set up for you by our team. See how it works for Pinterest on Shopify.

Not sure whether your tags are sending what they should? Start with the free Tracking Check. It looks at your site in about two minutes, no signup. If you'd rather talk it through, book a call with me.

Sources

Get tracking tips by email

Short, practical fixes for Meta, Google Ads and GA4, from Abir.

You’re in. First tip lands soon.

Abir Molla
Written by Abir Molla

Tracking specialist. He builds and runs KiteTrack, and explains tracking on YouTube.

Keep reading

Let your ads see every sale.

30-day money-back guarantee · free migration · cancel any time