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

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, like 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 an optional name for your tag and turn on Automatic Enhanced Match or optionally Metadata Enrichment
  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 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 corner.
  7. Click Save in the top-right 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 optimize 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 have 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 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 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’d like, check the box next to Custom Parameters for audience targeting.
  • Click Advanced Settings, then select Tag Sequencing.
  • Check 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 dropdown menu.
  • Click Triggering and select the specific action or page where you'd like your event to fire.
  • Click Save in the top-right corner.
  • Send in multiple product IDs

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

  • Select an event from the Event to Fire dropdown menu.
  • 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
  • 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 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 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 event ID

    You can also include event ID information for deduplication purposes.

  • Click the field below Event to Fire, then select an event from the list
  • Check the box next to Custom Parameters
  • Click Add Row to add a variable
  • 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
  • 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?