Pinterest Pixel Installation Procedures

Master Pinterest Pixel setup to track user behavior and boost conversion insights across your sales funnel.

Ceyhun Enki Aksan
Ceyhun Enki Aksan Entrepreneur, Maker

If you’re running online sales, you may need to integrate with many platforms depending on your target audience. One of them is Pinterest, which offers a highly effective discovery feature.

Your potential customers may be using Pinterest to discover new content, organize their findings through boards, and share them with other users. Naturally, interaction reports associated with your profile provide you with clear insights into this behavior. If engagement meets your expectations, you may wish to proceed to the next stage, where you can measure how closely these interactions align with your brand objectives, automatically sync product listings with your catalog, and assess how much of the engagement generated from your products translates into conversions.

At this stage, the priority is obviously to set up campaigns and ensure that conversions are properly captured.

Pinterest Ads

Pinterest Ads1 enable the execution of comprehensive digital marketing campaigns2 through Pinterest, allowing users to access pins, home ideas, styling concepts, and other inspiration directly through advertisements3.

Pinterest User Events
Pinterest User Events

Pinterest Code Management

To properly track and analyze product interactions during the execution of digital marketing campaigns, you’ll need to include a snippet of code containing Pinterest’s pixel on your website. This can be accomplished either through direct code insertion or via tag management tools such as Google Tag Manager[^18].

Code management consists of two phases:

  • Base Code (installation code, or more generally, the base code)
  • Events Code (event setup)

INSTALLATION CODE (base code): The code snippet inserted between the <head> and </head> tags, containing the Pinterest ID, essentially combines the pintrk with various values and tracks page views. Additional actions are performed on top of this code. The YOUR_TAG_ID placeholder within the following code snippet must be replaced with the Pinterest ID. This code version may vary depending on updates4.

<head>
 <!-- Pinterest Pixel Base Code -->
 <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', 'YOUR_TAG_ID');
   pintrk('page');
 </script>
 <noscript>
   <img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&event=init&noscript=1" />
 </noscript>
 <!-- End Pinterest Pixel Base Code -->
</head>

For the tracking code to function and for the creation of audience data related to the website, this code snippet must be added to every page of the website. The tracking code must be loaded prior to the tracking events.

Pinterest Base Installation Code
Pinterest Base Installation Code
Pinterest - Tag Manager
Pinterest - Tag Manager

For more details on event management, you can also refer to the Conversions > Tag Manager section under Pinterest Ads1.

Pinterest Integrations
Pinterest Integrations

Additionally, direct account linking operations can also be performed using ready-to-use integration options.

Google Tag Manager - Pinterest Setup Process
Google Tag Manager - Pinterest Setup Process

When using a tag manager such as Google Tag Manager5 6, templates can be utilized for both setup and event definition. This enables the execution of code operations through the user interface without any potential code errors. In this case, it is essential to ensure that the relevant fields (field) are receiving data in the specified manner 7.

dataLayer = [{ 
    items : [
      {
        product_id: '1414',
        product_category: 'Shoes'
      },
      {
        product_id: 'ABC',
        product_category: 'Toys'
      }
     ]
}];

The Google Analytics product object can also be processed by configuring parameters within these fields6.

Pinterest Product Parameters
Pinterest Product Parameters

Beyond the setup code, the available events can be summarized as follows:

EventPurpose
CheckoutTracks users who complete a purchase (transaction)
AddToCartTracks users who add products to their cart
PageVisitTracks users who view products, articles, and similar important content
SignupTracks users who sign up for a product and/or service
WatchVideoTracks users who watch videos
LeadTracks individuals who show interest in a product and/or service
SearchTracks users who perform searches for specific products or store locations on your website
ViewCategoryTracks users who view category, collection, campaign, and similar product listing pages
CustomTracks users who perform a custom event intended for inclusion in conversion reports
[User-defined event]Custom events defined for audience targeting. Unique events cannot be used for conversion tracking.
Google Tag Manager - Pinterest Events
Google Tag Manager - Pinterest Events

Tag managers, such as Google Tag Manager, provide event definitions for relevant events.

All spaces in the event names Custom and User-defined event are removed. Therefore, ensure that event names are correctly formatted. For details regarding event testing, refer to the “Event Testing” section.

Events can be defined directly via JavaScript code snippet and IMG pixel code as follows.

<script>
 pintrk('track', 'addtocart', {
   value: 10.00,
   order_quantity: 1,
   currency: 'USD'
 });
</script>

<noscript>
 <img height="1" width="" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&event=addtocart&ed[value]=10.00&ed[order_quantity]=2&noscript=1" />
</noscript>

Regarding campaigns, it is recommended that at least one of the following events be added to ensure proper tracking of user behavior:

  • Checkout
  • AddToCart
  • Signup
  • Lead

For accurate performance measurement, it is essential that both Pageview and AddToCart events contain the product identifier matching the Checkout event (product id or variant id).

Pinterest Conversion Tag

The Checkout event must be defined for catalog sales objectives and dynamic retargeting. For the Checkout event to function correctly, the product identifier (product id or variant id as product_id), product value (product-specific product_price and total value), and currency (currency) fields must have values assigned 8 9.

pintrk('track', 'checkout', {
   value: 116,
   order_quantity: 2,
   currency: 'USD',
   line_items: [
     {
       product_name: 'Pillows (Set of 2)',
       product_id: '11',
       product_price: 48.00,
       product_quantity: 1
     },
     {
       product_name: 'Pillows, Large (Set of 2)',
       product_id: '15',
       product_price: 68.00,
       product_quantity: 1
     },
   ]
 });
<img height="1" width="1" style="display:none;" alt="" src="https://ct.pinterest.com/v3/?tid=YOUR_TAG_ID&event=checkout&ed[value]=10.00&ed[order_quantity]=2&ed[currency]=USD&ed[line_items][0][product_name]=Parker+Boots&[line_items][0][product_id]='1414'&ed[line_items][0][product_price]=5.00&ed[line_items][0][product_quantity]=1&ed[line_items][1][product_name]=Parker+Sandals&ed[line_items][1][product_id]='ABC'&ed[line_items][1][product_price]=5.00&ed[line_items][1][product_quantity]=1&noscript=1"/>

Testing Events

The Page action is also included; there are two different methods available for verifying Pinterest actions. The first method is the Pinterest Tag Helper10, a Chrome extension provided by Pinterest. With this, you can view the values taken by actions and their parameters on a page basis.

The second method is a test page provided via Pinterest Ads1 and accessible by following the Conversions > Test Events steps. This page enables viewing detailed parameter information for actions that reach Pinterest’s servers through the specified domain. This allows you to also verify whether the data is being sent correctly to the server.

Catalog

This enables the direct transfer of products listed on a website as a feed to Pinterest11 12. This process can be carried out directly and/or through services such as GoDataFeed, ChannelAdvisor, and Feedonomics13.

The required fields for the catalog are summarized in the table below:

FieldDescriptionExample
idProduct ID. Maximum of 127 characters.[var]DS0294-L[/var]
titleProduct name/title. Maximum of 500 characters.[var]Women’s denim shirt, large[/var]
descriptionProduct description. Maximum of 10,000 characters.[var]Casual fit denim shirt made with the finest quality Japanese denim.[/var]
linkMaximum of 511 characters.[var]https://www.example.com/cat/womens-clothing/denim-shirt-0294[/var]
image_linkAn image representing the product. Must be at least 75x75px in size.[var]https://scene.example.com/image/image.jpg[/var]
priceProduct price. A numeric value. If no currency is specified, the default is USD. Different formats should be sent in ISO 4217 format14.[var]24.99 USD[/var]
availabilityContains inventory status.[var]in stock[/var]

ID Mismatch Issue

The product IDs sent must match the item_group_id or id provided in the data source. For this reason, the product_id in Pageview, AddToCart, and Checkout events must have the same ID (ID) value for each product.

If the product ID has changed over time and the catalog has not been updated, a mismatch error will occur. On the other hand, for variant products, the relevant product ID must be passed along with the corresponding variant ID. If the product ID instead of the variant ID is passed, variants will be evaluated under the same ID. This situation will again result in a mismatch between the catalog and the ID.

Shopify Pinterest App
Shopify Pinterest App

Shopify

The Pinterest App available via the Shopify App Store15 can help streamline the management of code events16.

Pinterest Help Center

Footnotes

  1. Pinterest Ads 2 3
  2. Advertising on Pinterest
  3. Marketing on Pinterest
  4. Add the base code. Pinterest Help Center
  5. Pinterest Conversion Tracking extension. Adobe Experience League
  6. Add the Pinterest tag to Google Tag Manager. Pinterest Help Center 2
  7. Add event codes. Pinterest Help Center
  8. Setup Pinterest Conversion Tracking Pixel on Shopify with Enhanced Matching
  9. Track conversions with the Pinterest tag
  10. Pinterest Tag Helper
  11. Add your data source. Pinterest Help Center
  12. Before you get started with Catalogs. Pinterest Help Center
  13. [Link your Shopify and Pinterest accounts.
  14. ISO 4217 Currency Codes. ISO
  15. Link your Shopify and Pinterest accounts. Pinterest Help Center
  16. Pinterest. Shopify App Store