Base code

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 primary code for Pinterest Tag. It needs to be added to every page of your website in order for any event codes to function and to build audience data from the traffic on your site. 

You can generate your individual base code in the Conversions page in Ads Manager, which contains your unique tag ID. You only need to generate one unique tag ID. Once generated, place your base code on every page of your website to track conversions and build audiences across your entire website.


It’s important to place the base code so that it loads first on the page. This is usually in the <head> section of your website’s HTML, but it may be different depending on your website. The base code needs to fire before the event code, so you need to place it so that it will fire before any event code you plan to implement.


Below is an example base code, but remember that you should retrieve your personalised base code from your profile in Ads Manager or the API. We do not recommend copying and pasting from this guide. When you obtain your base code from Ads Manager, it will have your unique Pinterest Tag ID inserted in the proper locations of the code, where you see 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 -->

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 always have the option to delete first-party cookies by updating your base code to set the fp_cookie parameter to false:

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

Next steps

Once you’ve finished adding the base code, you can add an event code.

Still need help?
Contact us