Add the base code

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

The base code is the foundation of the Pinterest tag. You have to add the base code to every page of your website so that event codes can function and audience data can be built from the traffic on your website. Always add the base code to the HTML code of all pages of your website before adding an event code.

Add the base code to your website

  1. Log into your Pinterest business account
  2. Click Ads at the top of your screen, then click Conversions
  3. Choose how you want to install the Pinterest tag:
    • Click Get started next to Use an integration partner to select which integration partner you want to use and follow the steps provided
    • Click Add code next to Add code to website to install the tag yourself
    • Click Email address next to Email instructions to send instructions to your technical support so they can install the tag for you
  4. After you click Add code, scroll down in the box that appears and click Copy code
  5. Paste the base code you copied in the global header of your website’s HTML, between the <head> and </head> tags so that it’s present on every page

Note: Where you place the base code might be different depending on your website.

Customize your base code

Delete first-party cookies

The Pinterest tag creates and accesses cookies in a first-party context on your site domain, providing better visibility into the Pinterest traffic on your site. 

You can delete first-party cookies by setting the fp_cookie parameter in your base code to false, like in the example below. Learn more about cookies and the Pinterest tag.

<script>
 pintrk('load', '<tag_id>', {
   'fp_cookie': false,
   'em': '<email address>',
 });
</script>

Metadata enrichment

If you’re using catalogs and shopping ads to showcase your products, Pinterest will use the tag to automatically update your product information to match the information on your website. This is referred to as metadata enrichment. 

If you want to opt out of metadata enrichment, update your base code to include {‘md_frequency’: 0}, like the example below. Keep in mind that opting out of metadata enrichment might reduce the distribution of your product Pins on Pinterest.


   window.pintrk('load', 'YOUR_TAG_ID', {'md_frequency': 0})
  

What's the next step?

Add event codes so you can track specific events when they happen on your website. 

Still need help?
Contact us