Pinterest Ads Event Tracking | Blue Frog Docs

Pinterest Ads Event Tracking

Complete guide to Pinterest Tag and conversion tracking

Pinterest Ads Event Tracking

Overview

Pinterest uses the Pinterest Tag (pixel) for conversion tracking, audience building, and campaign optimization. The platform also supports the Pinterest Conversions API for server-side tracking and enhanced measurement. Pinterest's visual discovery focus makes conversion tracking essential for retail, ecommerce, home decor, fashion, and lifestyle brands.

Standard Events

Pinterest provides predefined events optimized for shopping and discovery:

Ecommerce Events

  • Checkout - Checkout process initiated
  • AddToCart - Product added to shopping cart
  • Purchase - Completed transaction (required for catalog campaigns)
  • ViewCategory - Product category page viewed
  • Search - Site search performed
  • WatchVideo - Video content watched

Lead Generation Events

  • Lead - Form submission or lead capture
  • Signup - Account registration or newsletter signup

General Events

  • PageVisit - Automatically tracked page view
  • Custom - Custom business-specific events

Catalog Events

For Pinterest Shopping campaigns, specific events are required:

  • PageVisit - Product detail page view
  • AddToCart - Product added to cart
  • Checkout - Checkout initiated
  • Purchase - Order completed

Custom Events

Creating Custom Events

Track business-specific actions with custom events:

// Custom event
pintrk('track', 'custom', {
  event_id: 'unique_event_id_123',
  custom_event_name: 'ProductComparison',
  value: 29.99,
  currency: 'USD'
});

Event Parameters

Add detailed parameters to any event:

pintrk('track', 'Lead', {
  value: 50.00,
  currency: 'USD',
  lead_type: 'newsletter',
  email_hash: hashEmail('user@example.com')  // SHA256 hash
});

Video Engagement

Track video interactions:

// Video start
pintrk('track', 'WatchVideo', {
  video_title: 'Product Demo',
  property: 'video_start'
});

// Video 25% complete
pintrk('track', 'WatchVideo', {
  video_title: 'Product Demo',
  property: 'video_25'
});

// Video complete
pintrk('track', 'WatchVideo', {
  video_title: 'Product Demo',
  property: 'video_complete'
});

Ecommerce Events

Purchase Tracking

Complete purchase implementation with product details:

<!-- Pinterest Tag Base Code (on all pages) -->
<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', 'YOUR_TAG_ID', {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=YOUR_TAG_ID&noscript=1" />
</noscript>

<!-- Purchase Event (on confirmation page) -->
<script>
pintrk('track', 'checkout', {
  value: 149.99,
  order_quantity: 3,
  currency: 'USD',
  line_items: [
    {
      product_name: 'Blue Widget',
      product_id: 'SKU_123',
      product_price: 99.99,
      product_quantity: 1,
      product_category: 'Widgets'
    },
    {
      product_name: 'Red Gadget',
      product_id: 'SKU_456',
      product_price: 25.00,
      product_quantity: 2,
      product_category: 'Gadgets'
    }
  ],
  order_id: 'ORDER_12345'
});
</script>

Shopping Funnel Events

Track the complete shopping journey:

// Product page view
pintrk('track', 'pagevisit', {
  line_items: [{
    product_id: 'SKU_123',
    product_name: 'Blue Widget',
    product_price: 99.99,
    product_category: 'Widgets'
  }]
});

// Add to Cart
pintrk('track', 'addtocart', {
  value: 99.99,
  currency: 'USD',
  line_items: [{
    product_id: 'SKU_123',
    product_name: 'Blue Widget',
    product_price: 99.99,
    product_quantity: 1,
    product_category: 'Widgets'
  }]
});

// Checkout
pintrk('track', 'checkout', {
  value: 149.99,
  order_quantity: 3,
  currency: 'USD',
  line_items: [
    {
      product_id: 'SKU_123',
      product_price: 99.99,
      product_quantity: 1
    },
    {
      product_id: 'SKU_456',
      product_price: 25.00,
      product_quantity: 2
    }
  ],
  order_id: 'ORDER_12345'
});

Dynamic Parameters

Required parameters for Pinterest Shopping:

pintrk('track', 'checkout', {
  value: 99.99,                    // Total order value
  currency: 'USD',                 // ISO currency code
  order_quantity: 2,               // Number of items
  order_id: 'ORDER_12345',        // Unique order ID
  line_items: [{
    product_id: 'SKU_123',        // Required: matches catalog
    product_name: 'Product Name',
    product_category: 'Category',
    product_variant: 'Blue',      // Color, size, etc.
    product_variant_id: 'VAR_123',
    product_price: 99.99,
    product_quantity: 2,
    product_brand: 'Brand Name'
  }]
});

Conversion Tracking

Implementation Methods

1. Pinterest Tag (Browser-Side)

Standard JavaScript implementation:

<!-- Base Tag (all pages) -->
<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");

// Enhanced matching with hashed email
pintrk('load', 'YOUR_TAG_ID', {
  em: '<hashed_email_address>'
});
pintrk('page');
</script>

<!-- Conversion Event -->
<script>
pintrk('track', 'checkout', {
  value: 99.99,
  currency: 'USD',
  order_id: 'ORDER_12345'
});
</script>

2. Google Tag Manager

Deploy Pinterest Tag via GTM:

Base Tag:

// GTM Custom HTML Tag - All Pages
<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', '{{Pinterest Tag ID}}');
pintrk('page');
</script>

Event Tracking:

// GTM Custom HTML Tag - Conversion Pages
<script>
pintrk('track', 'checkout', {
  value: {{Transaction Value}},
  currency: 'USD',
  order_id: {{Transaction ID}},
  order_quantity: {{Item Count}}
});
</script>

3. Pinterest Conversions API

Server-side tracking for enhanced accuracy:

// Node.js example
const axios = require('axios');
const crypto = require('crypto');

function hashData(data) {
  return crypto.createHash('sha256').update(data.toLowerCase().trim()).digest('hex');
}

const conversionData = {
  event_name: 'checkout',
  action_source: 'web',
  event_time: Math.floor(Date.now() / 1000),
  event_id: 'ORDER_12345_' + Date.now(),  // Deduplication ID
  event_source_url: 'https://example.com/checkout/success',
  user_data: {
    em: [hashData('user@example.com')],  // Hashed email
    ph: [hashData('+15551234567')],      // Hashed phone
    client_ip_address: '192.168.1.1',
    client_user_agent: 'Mozilla/5.0...'
  },
  custom_data: {
    value: 99.99,
    currency: 'USD',
    order_id: 'ORDER_12345',
    order_quantity: 2,
    contents: [{
      item_id: 'SKU_123',
      item_name: 'Blue Widget',
      item_price: 99.99,
      item_quantity: 2,
      item_category: 'Widgets'
    }]
  }
};

const response = await axios.post(
  'https://api.pinterest.com/v5/ad_accounts/YOUR_AD_ACCOUNT_ID/events',
  { data: [conversionData] },
  {
    headers: {
      'Authorization': `Bearer YOUR_ACCESS_TOKEN`,
      'Content-Type': 'application/json'
    }
  }
);

4. E-commerce Platform Integrations

Official integrations for seamless tracking:

Shopify:

  • Pinterest app from Shopify App Store
  • Automatic tag installation
  • Product catalog sync
  • Automatic conversion tracking

WooCommerce:

BigCommerce, Magento, PrestaShop:

  • Native Pinterest integrations available
  • Automated tag management
  • Catalog synchronization

Enhanced Matching

Improve conversion matching with user data:

// Enhanced matching via Pinterest Tag
pintrk('load', 'YOUR_TAG_ID', {
  em: hashEmail('user@example.com'),     // SHA256 hashed email
  ph: hashPhone('+15551234567'),         // SHA256 hashed phone
  ge: hashGender('f'),                   // SHA256 hashed gender
  db: hashBirthday('19900101'),          // SHA256 hashed birthday (YYYYMMDD)
  ln: hashLastName('doe'),               // SHA256 hashed last name
  fn: hashFirstName('jane'),             // SHA256 hashed first name
  ct: hashCity('san francisco'),         // SHA256 hashed city
  st: hashState('ca'),                   // SHA256 hashed state
  zp: hashZip('94102'),                  // SHA256 hashed zip
  country: hashCountry('us')             // SHA256 hashed country
});

function hashEmail(email) {
  // Implementation of SHA256 hash
  return CryptoJS.SHA256(email.toLowerCase().trim()).toString();
}

Event Deduplication

Prevent duplicate events when using Tag + API:

// Browser-side with event_id
const eventId = 'ORDER_12345_' + Date.now();

pintrk('track', 'checkout', {
  value: 99.99,
  currency: 'USD',
  order_id: 'ORDER_12345',
  event_id: eventId  // Unique identifier
});

// Server-side with matching event_id
// Use same eventId value in API call

Offline Conversions

Conversions API for Offline Data

Upload offline conversions via API:

import requests
import hashlib
import time

def hash_data(data):
    return hashlib.sha256(data.lower().strip().encode()).hexdigest()

# Prepare conversion data
conversion = {
    "event_name": "checkout",
    "action_source": "offline",
    "event_time": int(time.time()),
    "event_id": "OFFLINE_ORDER_12345",
    "user_data": {
        "em": [hash_data("customer@example.com")],
        "ph": [hash_data("+15551234567")]
    },
    "custom_data": {
        "value": 99.99,
        "currency": "USD",
        "order_id": "OFFLINE_ORDER_12345"
    }
}

# Send to Pinterest API
headers = {
    "Authorization": f"Bearer {access_token}",
    "Content-Type": "application/json"
}

response = requests.post(
    f"https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/events",
    json={"data": [conversion]},
    headers=headers
)

CRM Integration

Connect CRM for automated offline conversion tracking:

Implementation Steps:

  1. Capture Pinterest click ID (_epik cookie) on website
  2. Store click ID in CRM with lead/customer record
  3. Export conversions from CRM with click IDs
  4. Upload via Conversions API

Supported Action Sources:

  • offline - In-store or phone sales
  • app_android - Android app conversions
  • app_ios - iOS app conversions
  • web - Website conversions

Attribution

Attribution Windows

Configure attribution settings per conversion event:

Default Windows:

  • Click-through: 30 days
  • View-through: 1 day
  • Engagement: 1 day (for engaged views)

Customizable Options:

  • Click: 1, 7, 14, 30, 60 days
  • View: 1, 7, 14, 30 days
  • Engagement: 1, 7, 14, 30 days

Configure in: Ads Manager > Conversions > Edit Conversion Event

Attribution Models

Pinterest uses last-touch attribution:

  • Last clicked Pin gets 100% credit
  • If no click, last viewed Pin gets credit
  • Engagement actions (close-ups, saves) may get credit within engagement window

Cross-Device Attribution

Automatic cross-device tracking for logged-in Pinterest users:

  • User saves Pin on mobile
  • User purchases on desktop
  • Both interactions counted in conversion path

Conversion Insights

View attribution data in Pinterest Analytics:

Available Metrics:

  • Total conversions
  • Click-through conversions
  • View-through conversions
  • Earned conversions (organic saves/clicks from Promoted Pins)

Breakdown Options:

  • By campaign, ad group, Pin
  • By device (mobile, desktop, tablet)
  • By audience segment
  • Over time

Debugging & Validation

Pinterest Tag Helper

Chrome extension for validating Pinterest Tag:

  1. Install Pinterest Tag Helper extension
  2. Visit page with Pinterest Tag
  3. Check status:
    • Tag detected and firing
    • Events tracked
    • Parameters passed
    • Warnings or errors

Tag Health in Ads Manager

Verify tag status in Pinterest:

  1. Navigate to Ads > Conversions
  2. Check Tag Health indicator
  3. Review:
    • Tag status (active/inactive)
    • Events received
    • Last event timestamp
    • Implementation errors

Conversion Event Manager

Test and validate conversion events:

Ads Manager > Conversions:

  • View all conversion events
  • Check event status (active/paused)
  • See recent conversion count
  • Test event firing

Real-Time Event Monitoring

View recent events in Pinterest:

  1. Navigate to Conversions page
  2. Click on conversion event
  3. View Event History tab
  4. See events from last 24 hours with:
    • Timestamp
    • Event parameters
    • Source (tag vs API)

Browser Console Testing

Verify Pinterest Tag in browser console:

// Check if pintrk is loaded
if (typeof window.pintrk !== 'undefined') {
  console.log('Pinterest Tag loaded');
  console.log('Tag queue:', window.pintrk.queue);
} else {
  console.error('Pinterest Tag not found');
}

// Fire test event
pintrk('track', 'custom', {
  event_id: 'test_' + Date.now()
});

Common Issues

Tag not firing:

  • Verify Tag ID is correct
  • Check script loads before events fire
  • Ensure no JavaScript errors in console
  • Test in incognito mode to rule out extensions

Events not appearing:

  • Wait 15-30 minutes for events to process
  • Verify event name is correct (case-sensitive)
  • Check required parameters are included
  • Review Tag Health for errors

Low match rates:

  • Implement enhanced matching with hashed emails
  • Use Conversions API for server-side tracking
  • Include more user identifiers
  • Verify hashing is done correctly (SHA256)

Best Practices

Implementation

  1. Install Pinterest Tag on all pages for remarketing and full funnel tracking
  2. Use both Tag and Conversions API for maximum data quality
  3. Implement enhanced matching with hashed user data
  4. Use Google Tag Manager for easier tag management
  5. Include product IDs that match your catalog feed

Event Strategy

  1. Track full funnel (PageVisit, AddToCart, Checkout)
  2. Use standard event names for optimal campaign delivery
  3. Create separate events for different conversion types
  4. Implement video tracking for content engagement
  5. Track searches to understand user intent

Data Quality

  1. Pass order_id for deduplication
  2. Include line_items with product details for Shopping campaigns
  3. Use consistent product_id format matching catalog
  4. Send accurate currency codes (3-letter ISO format)
  5. Hash all PII before sending (SHA256)

Pinterest Shopping

  1. Match product_id to catalog feed exactly
  2. Include all required fields (product_id, price, quantity)
  3. Track PageVisit on product detail pages
  4. Implement AddToCart event for remarketing
  5. Use Checkout event for purchase conversions

Privacy & Compliance

  1. Implement consent management for GDPR/CCPA
  2. Hash all PII using SHA256 before sending
  3. Use opt_out parameter for users who decline tracking
  4. Update privacy policy to disclose Pinterest tracking
  5. Respect Limited Data Use settings for California users

Optimization

  1. Use conversion-based bidding for Shopping campaigns
  2. Optimize to Checkout events for ecommerce
  3. Create audiences from PageVisit and AddToCart events
  4. Exclude converted users from acquisition campaigns
  5. Test different attribution windows based on customer journey

Catalog Campaigns

  1. Sync product catalog before implementing conversion tracking
  2. Ensure product_id consistency between catalog and events
  3. Include product_variant for items with multiple options
  4. Track out-of-stock status in catalog
  5. Update prices in real-time or daily

Testing

  1. Use Pinterest Tag Helper to verify implementation
  2. Test events on staging environment first
  3. Generate test conversion and verify in Ads Manager
  4. Check Event History for parameter accuracy
  5. Monitor Tag Health for 48 hours after launch

Reporting

  1. Break down by device to understand mobile vs desktop performance
  2. View earned conversions to measure organic amplification
  3. Compare attribution windows to understand impact
  4. Segment by audience to optimize targeting
  5. Export conversion data for external analysis

Creative Optimization

  1. Track saves and clicks to measure Pin engagement
  2. Analyze video completion rates for video Pins
  3. Test different Pin formats (standard, carousel, video)
  4. Use conversion data to inform creative direction
  5. Optimize for mobile where most Pinterest activity occurs
// SYS.FOOTER