TLDR: Pinterest Tag requires consent for EU users. GetCookies blocks it until marketing consent using a simple data attribute. Perfect for e-commerce and lifestyle brands.
Read full summary
Pinterest advertising is powerful for e-commerce. But like all tracking pixels, the Pinterest Tag requires proper consent handling in the EU. This guide shows how to implement it correctly with GetCookies.
Summary by Claude AI
Pinterest Ads + E-commerce = Powerful
Pinterest is where purchase intent lives. Users come to discover, plan, and buy. For e-commerce and lifestyle brands, Pinterest ads convert.
But there's a catch: Pinterest Tag requires consent in the EU, just like Meta and TikTok.
Pinterest's Consent Options
Pinterest Tag supports limited data processing:
// Set limited data processing
pintrk('set', { np: 'ldu' });
But the cleaner approach is blocking the tag entirely until consent.
The GetCookies Implementation
<head>
<!-- GetCookies first -->
<script src="https://getcookies.co/api/v1/widget/loader.js"
data-domain-id="YOUR_DOMAIN_ID"
async></script>
<!-- Pinterest Tag - only loads after marketing consent -->
<script type="text/plain" data-cookieconsent="marketing">
!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>
</head>
The type="text/plain" blocks execution. GetCookies activates it after marketing consent.
Event Tracking
After consent, track standard Pinterest events:
// Page visit
pintrk('page');
// Add to cart
pintrk('track', 'addtocart', {
product_id: 'SKU123',
product_name: 'Awesome Product',
value: 29.99,
currency: 'USD'
});
// Checkout
pintrk('track', 'checkout', {
value: 99.99,
currency: 'USD',
order_quantity: 3
});
// Search
pintrk('track', 'search', {
search_query: 'summer dresses'
});
Dynamic Loading Pattern
window.addEventListener('getcookies:consent', (e) => {
if (e.detail.marketing && !window.pinterestLoaded) {
loadPinterestTag();
window.pinterestLoaded = true;
}
});
function loadPinterestTag() {
!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');
}
Pinterest Conversions API (Server-Side)
For better attribution, combine with server-side tracking:
import requests
url = "https://api.pinterest.com/v5/ad_accounts/{ad_account_id}/events"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
payload = {
"data": [{
"event_name": "checkout",
"action_source": "web",
"event_time": 1640000000,
"event_id": "unique_event_id",
"user_data": {
"em": ["hashed_email"]
},
"custom_data": {
"value": "99.99",
"currency": "USD"
}
}]
}
response = requests.post(url, headers=headers, json=payload)
Testing
- Install Pinterest Tag Helper extension
- Load site in incognito
- Before consent: Tag should NOT fire
- After marketing consent: Events should appear
Best Practices
- Use data-cookieconsent attribute - Simplest approach
- Combine with Conversions API - Better attribution
- Use event_id for deduplication - When using both browser and server
- Test with Pinterest Tag Helper - Verify implementation
The Bottom Line
Pinterest Tag needs consent management. GetCookies makes it simple:
- Add the
data-cookieconsent="marketing"attribute - Set
type="text/plain"on the script - Done
Your Pinterest ads work. Your site is compliant.
Ready to make your Pinterest Tag compliant?