It looks as though you're viewing this from a region where Pinterest Tag isn't available yet. See where Pinterest Tag is available to Pinterest Business accounts. Learn more

You can connect your Google Tag Manager account with your Pinterest tag to find out how much Pinterest influences traffic to your store and sales of your products.

Add the base code

The base code allows you to gather data on events, such as someone buying a product or adding a product to their shopping basket. The base code must be installed across all pages of your website. You can choose whether to install the base code on Pinterest or Google Tag Manager.

  1. Log in to your business account
  2. Click Ads, then select Conversions
  3. Click Get started under Install the Tag
  4. Select Google Tag Manager in the Partner integration window, then click Continue
  5. In the new tab that opens, select a Google account to log in to and click Allow
  6. If the info below Account and Container is correct, click Continue
  7. Enter a name for your tag (optional) and turn on Automatic Enhanced Match or Metadata Enrichment (optional)
  8. Click Install Tag
  1. Go to Google Tag Manager and click Add a new tag. The workspace of Google Tag Manager
  2. Enter a name for your tag at the top of the screen where it says Untitled Tag.
  3. Click Tag Configuration. A square around 'Tag configuration' for a new tag
  4. Click the search alt icon in the top right-hand corner of the page and start typing Pinterest in the search bar. Click Pinterest Tag when it appears below.
  5. Enter your Pinterest Tag ID from your Pinterest account’s Conversions page below Tag ID.
  6. Click Triggering and select the trigger that will track every page of your site, such as All Pages, then click Add in the top right-hand corner.
  7. Click Save in the top right-hand corner.
Add event codes

Event codes let you measure the impact your Pinterest ads have on certain onsite actions. They’re also necessary to launch campaigns that will automatically optimise specific events such as conversion campaigns or dynamic retargeting ads. Event codes are also necessary for accessing surfaces such as conversion insights.

Before you install your first event code, you need to install the base code. The base code should always be set up to fire before the event code. You can only install event codes in Google Tag Manager.

  • Click the name of your tag below Workspace Changes to open it.
  • Click Tag Configuration.
  • Click the drop-down menu below Event to Fire and select the event you’d like to track on your website.
    • Depending on what you choose, optional inputs will appear. You can enter a value or click the brick icon and choose the data layer variable for the relevant event data.
    • For AddToBasket, Checkout and PageVisit event tags, you can add a dynamic variable for product_id event data for audience creation and retargeting.
      • The product_id dynamic variable doesn't need any extra syntax, it just needs to populate the ID that matches your inventory.
      • If you expect or want to send multiple product_ids at the same time, you’ll need to set up a data layer variable to use our line_items syntax. See below for the structure and an example of a line_items array.
  • If you wish, tick the box next to Custom Parameters for audience targeting.
  • Click Advanced Settings, then select Tag Sequencing.
  • Tick the box next to Fire a tag before <your tag> fires.
  • Click Select Tag and choose the base tag you set up previously from the drop-down menu.
  • Click Triggering and select the specific action or page where you'd like your event to fire.
  • Click Save in the top right-hand corner.
  • Send in multiple product IDs

    You can enter multiple product IDs at the same time to track traffic on all of your products.

  • Select an event from the Event to Fire drop-down menu.
  • Tick the box next to Custom Parameters. Leave Product ID and Product Category under Line Items blank when you’re adding custom parameters. Custom Parameters box ticked in Tag Configuration in Google Tag Manager
  • Click Add Row to add a variable.
  • Enter a name for your variable below Name, then click + below Value.
  • Select an existing variable from the list or click + in the top right-hand corner to create a new variable. Google Tag Manager interface showing custom parameters saved
  • Click Triggering to set any triggers needed for your site.
  • Click Save.
  • In order for this to work, you'll also need to create a data layer variable called 'items' on any pages where you want to set the product IDs and product categories. You can set all of them here:

      dataLayer = [{ 
        items : [
            product_id: '1414',
            product_category: 'Shoes'
            product_id: 'ABC',
            product_category: 'Toys'

    Once you've added the data layer, deploy or save your website's code.

    Content security policies

    If you’re using a content security policy with your Google Tag Manager tag container, add these domains as exceptions to any rules preventing code from accessing scripts:

  • End of Other articles Links
    Still need help? Contact us
    User feedback
    Was this article helpful?


    How can we make this article better?