Examples of combined base and event codes

 

Here are some examples of base codes combined with event codes. Remember to confirm that the event code is placed after the base code on your website. 

Example 1: Track a pagevisit event with no additional event data

  • Example conversion tag ID 123456789 (replace with your Pinterest conversion tag ID)

  • Example event code: pagevisit

<head>
 <script type="text/javascript">
 !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', '123456789'); pintrk('page');
 </script>
 <noscript>
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=123456789&noscript=1" />
 </noscript>
 <script>
   pintrk('track', 'pagevisit');
 </script>
 <noscript>
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=123456789&event=pagevisit&noscript=1" />
 </noscript>
</head>

Example 2: Fire two event codes on one page

  • Example conversion tag ID 123456789 (replace with your Pinterest conversion tag ID)

  • Example event codes: pagevisit and addtocart

<head>
 <script type="text/javascript">
 !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', '123456789'); pintrk('page');
 </script>
 <noscript>
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=123456789&noscript=1" />
 </noscript>
 <script>
   pintrk('track', 'pagevisit');
   pintrk('track', 'addtocart');
 </script>
 <noscript>
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=123456789&event=pagevisit&noscript=1" />
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=123456789&event=addtocart&noscript=1" />
 </noscript>
</head>

 

Still need help?
Contact us