Install Pinterest tag script

Modified on Tue, 22 Mar 2022 at 06:06 PM

The Pinterest tag is a piece of code that you add to your website which lets Pinterest track visitors to your site as well as the actions they take on your site after seeing your Pinterest ad. You can generate this code from your Pinterest settings. 


To implement the Pinterest tag



In Pinterest 



  • Sign in to your Pinterest account and go to your settings.
  • Find the Claim section. Enter your Pattern site URL and then click Claim.
  • Copy the entire tag that displays in the pop-up window.


In Valigara


  • Go to VSite settings -> Basic tab
  • Block "Other" -> Header script (visible in Advanced view)
  • Add the script code below 
    • Replace XXXXXXXXXXX with your Pinterest Tag ID (it will look like 1234567890 ) 


More information on the Pinterest site



<!-- Pinterest Tag -->
<script>
!function(e){if(!window.pintrk){window.pintrk = function () {
window.pintrk.queue.push(Array.prototype.slice.call(arguments))};var
  n=window.pintrk;n.queue=[],n.version="3.0";var
  t=document.createElement("script");t.async=!0,t.src=e;var
  r=document.getElementsByTagName("script")[0];
  r.parentNode.insertBefore(t,r)}}("https://s.pinimg.com/ct/core.js");
pintrk('load', 'XXXXXXXXXXX', {em: '<user_email_address>'});
pintrk('page');
</script>
<noscript>
<img height="1" width="1" style="display:none;" alt=""
  src="https://ct.pinterest.com/v3/?event=init&tid=XXXXXXXXXXX&pd[em]=<hashed_email_address>&noscript=1" />
</noscript>
<script>
   pintrk('track', 'pagevisit', {
   product_id: 'data-product-id'
 });
   pintrk('track', 'addtocart', {
   product_id: 'data-product-id'
 });
 pintrk('track', 'checkout', {
   value: 116,
   order_quantity: 2,
   currency: 'USD',
   line_items: [
     {
       product_name: 'product-title',
       product_id: 'data-product-id',
       product_price: 'price-col',
       product_quantity: 'quantity-col'
     }
   ]
 });
 </script>
 <noscript>
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=XXXXXXXXXXX&event=pagevisit&noscript=1" />
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=XXXXXXXXXXX&event=addtocart&noscript=1" />
<img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=XXXXXXXXXXX&event=checkout&noscript=1" />
 </noscript>
<!-- end Pinterest Tag -->


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article