Google Tag Manager and Pinterest tag

Implement base code

  1. Go to Google Tag Manager and click New Tag.

  2. Name your tag.

  3. Go to "Tag configuration" which is where the code goes.

  4. Click the pencil and select Pinterest Tag under "More".

  5. Enter your tag ID, which can be found on the Conversions page. You can also choose a variable to reuse for all your Pinterest tags.

  6. Click the brick and choose your website’s data layer variable for email or create a new one.

  7. Go to the "Event to Fire" drop down and choose "Base code only (no event)", which stands in as the base code.

  8. Go to “Triggering” and choose the trigger that will track every page of your site.

  9. Click Save.

Implement event code

  1. Go to Google Tag Manager and click New Tag.

  2. Name your tag.

  3. Go to "Tag configuration", which is where the code goes.

  4. Click the pencil and select Pinterest Tag under "More".

  5. Enter your tag ID, which can be found in the conversions page. You can also choose a variable to reuse for all your Pinterest tags.

  6. Click the brick and choose your website’s data layer variable for email or create a new one.

  7. Go to the "Event to Fire" drop down and select the event that you'd like to track on your website.

  8. Depending on what you choose, optional inputs will appear. You can enter a static value or click the brick and choose the data layer variable for the relevant event data.

  9. 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.

  10. If you’d like, choose custom parameters for audience targeting.

  11. Go to "Triggering" and select the specific action or page where you'd like your event to fire.

  12. Click Save.

To verify your tag and view reporting, download the Pinterest tag helper or view your event history. Check out Google's page on the Tag Manager for more information.

How to send in multiple product IDs

  1. Select ‘Custom Parameters’ for the event, and leave the Product ID and Product Category under the ‘Line Items’ heading above blank.
    Google tag manager showing custom parameter selected
  2. For the value of this parameter, click Google Tag Manager variable selector icon to enter a variable.
  3. Create a new data-layer variable called items (you can use any name you like, we’re just calling it items for this example)
    Google Tag manager interface showing items data layer
  4. When you save, the custom parameters should look like this
    Google Tag Manager interface showing custom parameters saved
  5. Set any triggers needed for your site (this is up to you), and then click Save.
  6. Create a data layer variable called items in your webpage anywhere 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>

     

  7. Deploy your 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 rule preventing code from accessing scripts:

  • s.pinimg.com
  • ct.pinterest.com
Still need help?
Contact us