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

Add the Pinterest tag to Google Tag Manager to find out how much Pinterest influences traffic to your store and sales of your products.

Add the base code

The base code has to be installed across all pages of your website and gathers data about different events, like when someone buys a product, or adds a product to their shopping cart.

  1. Log in to your Pinterest business account
  2. Click the hamburger icon at the top-left of the page
  3. Under Business, click Conversions
  4. Click Get started
  5. Select your connection source, then click Continue
  6. Click Skip
  7. Select Google Tag Manager, then click Continue
  8. Follow the prompts to complete installing the base code
  9. Go to Google Tag Manager to confirm the newly created tag
Add an event code

Event codes let you measure the impact your Pinterest ads have on certain onsite actions. They’re also necessary if you want to launch specific ad campaigns and use specific Pinterest features.

Before you install your first event code, you have to install the base code. The base code should always be set up to fire before the event code.

Keep in mind that you’ll have to follow the steps below each time you add an event.

  1. Go to Google Tag Manager and click Add a new tag.
  2. Enter a name for your tag at the top of the screen where it says Untitled Tag.
  3. Click Tag Configuration.
  4. Click the search icon the top-right 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.
    • You can also choose a variable to reuse by clicking the plus icon next to Tag ID.
  6. Click the dropdown 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 addtocart, 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 does not 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.
  7. Optional: Check the box next to Custom Parameters for audience targeting.
  8. Click Advanced Settings, then select Tag Sequencing.
  9. Check the box next to Fire a tag before <your tag> fires.
  10. Click Select Tag and choose the base tag you set up previously from the dropdown menu.
  11. Click Triggering and select the specific action or page where you'd like your event to fire.
  12. Click Save at the top-right corner
  13. Click Submit to publish the change
Send in multiple product IDs

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

  1. Go to Google Tag Manager.
  2. Click the event code or tag you want to add product IDs to.
  3. Select an event from the Event to Fire dropdown menu.
  4. Check 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 checked in Tag Configuration in Google Tag Manager
  5. Click Add Row to add a variable.
  6. Enter a name for your variable below Name, then click + below Value.
  7. Select an existing variable from the list or click + at the top-right corner to create a new variable. Google Tag Manager interface showing custom parameters saved
  8. Click Triggering to set any triggers needed for your site.
  9. Click Save.

In order for this to work, you'll also need to create a data layer variable called "items" on any page you want to set the product IDs and product categories. You can set all of them here:

<script>
  dataLayer = [{ 
    items : [
      {
        product_id: '1414',
        product_category: 'Shoes'
      },
      {
        product_id: 'ABC',
        product_category: 'Toys'
      }
     ]
    }];
</script>

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

Send in an event ID

You can also include event ID information for deduplication purposes.

  1. Go to Google Tag Manager
  2. Click the event code or tag you want to add product IDs to
  3. Click the field below Event to Fire, then select an event from the list
  4. Check the box next to Custom Parameters
  5. Click Add Row to add a variable
  6. Below Name, enter ‘event_id’ as the name for your variable, then click the plus icon below Value to provide a value
    • Note: The Value should be dynamically generated for each event in order to be unique to the eventWhite screen featuring the tag configuration settings
  7. Click Save
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 rule preventing code from accessing scripts:

  • s.pinimg.com
  • ct.pinterest.com
  • End of Other articles Links
    Still need help? Contact us
    User feedback
    Was this article helpful?

    collection_fields

    How can we make this article better?