The Pinterest tag: install, events and checking it

The Pinterest tag is the code that tells Pinterest Ads Manager what people do on your website after they see or engage with your ads. This guide covers the base code, the event codes and the event data that campaigns need, installing through Google Tag Manager, enhanced match, consent, testing with Ads Manager and the Pinterest Tag Helper, and pairing the tag with the Conversions API, using what Pinterest states in its help pages.

This guide is built from Pinterest's Business Help pages, mainly Install the Pinterest tag, Add the base code to your website and Add event codes, plus the pages linked in each section. Setting up the business and advertiser accounts is in our Pinterest for business guide; catalogs and dynamic retargeting are in our guide to Pinterest shopping ads.

What the tag does

Pinterest describes the tag as "a piece of code that you add to your website" that tracks visitors and "the actions they take on your site after seeing your Pinterest ad". With it installed, Pinterest lists five things you can do:

  • track and optimise conversions;
  • measure campaign performance;
  • build audiences for targeting (see our guide to Pinterest ads targeting);
  • become a verified merchant;
  • access conversion insights.

You need a Pinterest business account and an advertiser account first. Pinterest says the tag "can take up to 24 hours to be reflected in Ads Manager" after you install it. It is not available in every country; Pinterest keeps a list of where the tag is available.

Three ways to install it

Start in your Pinterest business account: the menu at the top left, then Conversions, then Get started. Pinterest then offers three routes:

  • Integration partner: enter your website URL and click Check. If your site runs on a supported platform, Pinterest shows the partner and its instructions. If you have already claimed your domain and it is eligible, the partners show up straight away.
  • Email instructions: send the code and steps to a developer or colleague.
  • Manual set-up: click Skip and add the code yourself, as described below.

Pinterest notes that installing the tag needs a desktop browser; the steps don't work from the mobile app.

The base code

The base code is "the foundation of the Pinterest tag" and goes on every page of your site, so event codes can work and audiences can build from your traffic. Copy it from Conversions > Tag manager > Install the Pinterest tag and paste it between <head> and </head>. It contains your unique tag ID in a pintrk('load', ...) line and a pintrk('page') call. Pinterest asks you not to copy sample code from help pages, but always the personalised code from your account.

The code has two parts: the JavaScript tag and an IMG tag inside <noscript>, which Pinterest says "acts as a backup in case people have disabled JavaScript in their browsers".

Event codes

Event codes record specific actions. Pinterest says they're "necessary to launch campaigns that will automatically optimize specific events", such as conversion campaigns and dynamic retargeting, and for conversion insights and the Verified Merchant Program. The base code goes on every page; an event code only on the pages where its action happens.

Pinterest lists 20 event types:

  • Shop: AddToCart, AddToWishlist, InitiateCheckout, AddPaymentInfo, Checkout, CustomizeProduct.
  • Leads and sign-ups: Lead, Signup, Subscribe, Contact, Schedule, SubmitApplication, StartTrial.
  • Browsing: PageVisit, ViewContent, ViewCategory, Search, WatchVideo, FindLocation.
  • Custom: an action unique to your business, which you create yourself.

In manual set-up you copy each event code from the same Conversions flow and paste it on the page where it should count. Placed that way, it fires on every page load. Pinterest's warning for buttons and forms: if the event should count only after a click or a submission, "make sure that the event code only runs as a result of that action". That needs someone who knows the page's JavaScript, or a tag manager trigger.

Events each campaign and feature needs

From Pinterest's tables on the event codes page:

  • Conversions campaigns: at least one of Signup, Lead, AddToCart or Checkout is required; Pinterest's table also lists product ID, order ID, value, currency and enhanced match for this campaign type.
  • Catalog sales: PageVisit, AddToCart and Checkout are required, with product ID, order ID and value, and a currency for AddToCart and Checkout.
  • Brand awareness, consideration and video views: no events required; PageVisit, Checkout, AddToCart, Lead and Signup are recommended for awareness and consideration.
  • Conversion insights and the Verified Merchant Program: PageVisit, AddToCart and Checkout, with currency.
  • Dynamic retargeting: PageVisit, AddToCart and Checkout, with product ID, value and currency.

Event data

An event can carry an object of event data. Pinterest says all of it can be used for audience targeting, but "only value and order_quantity event data are available for paid and organic conversion reporting". The fields you will use most:

  • value and currency: the order value and a three-letter currency code; Pinterest converts it to your ad account currency.
  • order_quantity and order_id: Pinterest says order_id "is required for conversion analysis reporting".
  • event_id: a unique ID per event, used to deduplicate against the Conversions API (accepted as eventID, event_id or eid).
  • line_items: an array with product_id, product_name, product_category, product_price, product_quantity, product_brand and variant fields.
  • lead_type, search_query and video_title for Lead, Search and WatchVideo.

Values must be dynamic: the real order total, not the example number from the help page. Pinterest also recommends repeating the event data in the IMG tag. For debugging, pintrk() accepts a callback function that reports whether the call was built correctly and, if not, the error.

Installing with Google Tag Manager

Pinterest's Google Tag Manager article covers both parts:

  1. Base code: in Conversions, choose Get started, then Google Tag Manager as the method, and follow the prompts; Pinterest creates the base tag in your container. Confirm it in GTM.
  2. Each event: in GTM add a new tag, choose the Pinterest Tag template, enter your tag ID, pick the Event to Fire and map its fields to data layer variables.
  3. Under Advanced Settings > Tag Sequencing, fire the base tag before the event tag. Pinterest says "The base code should always be set up to fire before the event code."
  4. Set the trigger (the thank-you page, the form submission), save and submit.

The template has an External Event ID field for deduplication and a "Read data from GA4 dataLayer" option, so a shop that already pushes GA4 ecommerce data can reuse it for products. Product line items are required for dynamic retargeting. Tags, triggers and preview mode are covered in our Google Tag Manager basics guide.

Enhanced match

Enhanced match sends hashed customer details with tag events, so Pinterest can attribute conversions "when there's no Pinterest cookie present" and across devices. There are two kinds:

  • Automatic enhanced match: the JavaScript tag picks up what customers type into form fields (email, names, phone, address, and so on) and hashes it in the browser with SHA-256. It is on by default for new tags and can be switched in Conversions > Tag manager. It needs the tag on every page that has a form, and not inside an iframe. The tag also stores the hashed values in first-party storage (_pin_aem_ls or, in some regions, the _pin_aem cookie) for one year.
  • Optional (manual) enhanced match: you pass the email yourself with an em value in the base code's load call. The JavaScript tag hashes raw emails before sending; in the IMG tag you must hash it yourself (SHA-256, SHA-1 or MD5, lowercase, no spaces). In GTM, use the Hashed Email field.

Pinterest recommends turning on automatic enhanced match even if you already use the manual version, and says it deletes the email value once matching is done.

The base code page says that if you operate in the EU, "you're required to obtain legally-compliant user consent before sending any events to Pinterest". The tag has its own consent call, pintrk('setconsent', true/false):

  • true: events are sent and first-party cookies and storage are set.
  • false: events are not sent and those first-party cookies and storage are deleted.

You can also turn first-party cookies off with 'fp_cookie': false in the load call. Pinterest's tag parameters and cookies page lists the cookies the tag reads, such as _epik (set when someone arrives from a Pinterest ad) and _pin_unauth (groups actions when Pinterest can't match the visitor), and says they "are persistent for one year". Connect the consent call to your cookie consent banner, or in GTM to its consent settings (our GTM consent overview).

Checking that it works

Pinterest's verify the tag page offers two tools:

  • Test events in Ads Manager: Conversions > Test events, enter your URL and click Launch. Use the site in the new tab (view products, add to cart) and the events appear in Ads Manager, with the data each one carried.
  • Pinterest Tag Helper: a Chrome extension whose icon shows how many events fired on the page. Click an event to see its data, for example the value and quantity of a test checkout. It also flags problems: an em value of "undefined" or "n/a" (normal on pages where the visitor isn't logged in), or the same product ID sent for many products.

Without extensions, open your browser's developer tools, filter the Network tab for ct.pinterest and check the query parameters: tid must match your tag ID, event is the event name, ed the event data. Once live, event history on the Conversions page shows recent activity, and the Conversions view of the reporting table shows counts per event. Reading those reports is covered in our Pinterest ads reporting guide.

The Event Quality Score (Conversions > Event Quality) grades your setup Good, Fair or Needs improvement from three things: customer information sent (such as IP address, email and external ID), product details (product ID, value, currency) and how well tag and API duplicates are matched. It is based on a 14-day average.

Tag plus Conversions API

The Conversions API sends events from your server instead of the browser, through a partner integration or a direct integration that needs a developer. Pinterest's getting started page recommends a dual setup: "pass the same events through Conversions API that you do through your Tag". To avoid counting a sale twice:

  • send the same event_id with the browser event and the matching server event;
  • send server events in close to real time, under an hour;
  • check the Deduplication tab in Events Overview, which shows event ID coverage and the rate of duplicates removed. Pinterest's event testing page says "It is important that most, if not all, events sent have event_id."

API access starts in Conversions > Set Up API, where you generate an access token for your developer. The same approach on other platforms is in our guides to the Meta pixel and Conversions API and the TikTok pixel.

How we set it up

This is our own practice, not Pinterest's guidance:

  • Where Pinterest offers an integration partner for the site's platform, we use it; on custom sites, Google Tag Manager, with the base tag sequenced first and fired only after consent.
  • A service business gets PageVisit plus Lead on the real form submission; a shop gets PageVisit, AddToCart and Checkout with order ID, value, currency and line items, which covers conversions, catalog sales and dynamic retargeting.
  • We add an event_id to every event from day one, even before the Conversions API, so adding the API later needs no tag changes.
  • We test with Test events and the Tag Helper, then check Event Quality after two weeks.

If you want help setting up Pinterest tracking, see our services.

Frequently asked questions

Where do I find my Pinterest tag code?

In your Pinterest business account, open the menu, click Conversions, then Tag manager and Install the Pinterest tag. The base code there contains your unique tag ID.

Where should the Pinterest base code go?

On every page of your website, between the head tags. Event codes go only on the pages where the action happens.

How long does the Pinterest tag take to show in Ads Manager?

Pinterest says it can take up to 24 hours after installation.

What is the Pinterest Tag Helper?

A Google Chrome extension from Pinterest that shows which tag events fire on a page and the data they send, and warns about problems such as empty enhanced match values.

Do I need the Conversions API if I have the Pinterest tag?

It is optional. Pinterest recommends sending the same events through both and deduplicating them with a matching event_id, for better conversion visibility.

For more on Pinterest advertising, see our guides to Pinterest ads cost and Pinterest Trends, and the LinkedIn Insight Tag and Snapchat Pixel.