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

The base code is the foundation of the Pinterest Tag. You need 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
  • Log in to your Pinterest business account
  • Click Ads at the top of your screen, then click Conversions
  • 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, then 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
  • After you click Add code, scroll down in the box that appears and click Copy code
  • 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.

    We do not recommend that you copy and paste this sample base code below. You should always get your personalised base code from your profile in the Conversions page of Ads Manager. The base code will have your unique Pinterest Tag ID in place of YOUR_TAG_ID in the code below. 

     <!-- Pinterest Pixel Base Code -->
     <script type="text/javascript">
       pintrk('load', 'YOUR_TAG_ID');
       <img height="1" width="1" style="display:none;" alt="" src="" />
     <!-- End Pinterest Pixel Base Code -->
    Customise 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 of 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. Find out more about cookies and the Pinterest Tag.

     pintrk('load', '<tag_id>', {
       'fp_cookie': false,
       'em': '<email address>',
    Metadata enrichment

    If you’re using catalogues and shopping ads to showcase your products, Pinterest will use the tag to update your product information automatically 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. Bear 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. 

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


    How can we make this article better?