Snapchat Ads Event Tracking
Overview
Snapchat Ads uses the Snap Pixel for browser-based conversion tracking and the Snapchat Conversions API (CAPI) for server-side measurement. With a predominantly Gen Z and Millennial audience, Snapchat's tracking capabilities enable advertisers to measure app installs, website conversions, and offline events across the platform's AR lenses, Stories, and Discover content.
Standard Events
Snapchat provides predefined events for common conversion actions:
Ecommerce Events
- PURCHASE - Completed transaction
- ADD_CART - Product added to shopping cart
- ADD_BILLING - Billing information added
- START_CHECKOUT - Checkout process initiated
- VIEW_CONTENT - Product or content page viewed
- ADD_TO_WISHLIST - Product saved to wishlist
Lead Generation Events
- SIGN_UP - Account registration or newsletter signup
- SUBSCRIBE - Paid subscription started
- COMPLETE_TUTORIAL - Tutorial or onboarding completed
- LEVEL_COMPLETE - App level or milestone achieved
Engagement Events
- PAGE_VIEW - Generic page view (automatically tracked)
- SEARCH - Site search performed
- SAVE - Content or product saved
- LIST_VIEW - Product list or category viewed
App Events
- APP_INSTALL - Mobile app installation
- APP_OPEN - App opened
- ACHIEVEMENT_UNLOCKED - In-app achievement
Custom Event
- CUSTOM_EVENT_1 through CUSTOM_EVENT_5 - Custom business events
Custom Events
Creating Custom Events
Use predefined custom event slots:
// Custom event example
snaptr('track', 'CUSTOM_EVENT_1', {
'description': 'Product Comparison',
'number_items': '3',
'user_type': 'premium'
});
Event Parameters
Add parameters to any event:
snaptr('track', 'SIGN_UP', {
'price': '0',
'currency': 'USD',
'sign_up_method': 'email',
'user_id': 'USER_12345'
});
Custom Parameters
Snapchat supports flexible custom parameters:
snaptr('track', 'PURCHASE', {
'price': '99.99',
'currency': 'USD',
'transaction_id': 'ORDER_12345',
'item_category': 'electronics',
'number_items': '2',
'customer_type': 'returning',
'shipping_method': 'express'
});
Ecommerce Events
Purchase Tracking
Complete ecommerce implementation:
<!-- Snap Pixel Base Code (on all pages) -->
<script type='text/javascript'>
(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()
{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};
a.queue=[];var s='script';r=t.createElement(s);r.async=!0;
r.src=n;var u=t.getElementsByTagName(s)[0];
u.parentNode.insertBefore(r,u);})(window,document,
'https://sc-static.net/scevent.min.js');
snaptr('init', 'YOUR_PIXEL_ID', {
'user_email': 'user@example.com' // Optional enhanced matching
});
snaptr('track', 'PAGE_VIEW');
</script>
<!-- Purchase Event (on confirmation page) -->
<script>
snaptr('track', 'PURCHASE', {
'currency': 'USD',
'price': '149.99',
'transaction_id': 'ORDER_12345',
'item_ids': ['SKU_123', 'SKU_456'],
'item_category': 'Apparel',
'number_items': '3',
'payment_info_available': '1',
'client_dedup_id': 'ORDER_12345' // Deduplication ID
});
</script>
Shopping Cart Events
Track the full purchase funnel:
// View Content (Product Page)
snaptr('track', 'VIEW_CONTENT', {
'item_ids': ['SKU_123'],
'price': '99.99',
'currency': 'USD',
'item_category': 'Apparel'
});
// Add to Cart
snaptr('track', 'ADD_CART', {
'item_ids': ['SKU_123'],
'price': '99.99',
'currency': 'USD',
'number_items': '1'
});
// Start Checkout
snaptr('track', 'START_CHECKOUT', {
'price': '149.99',
'currency': 'USD',
'number_items': '3'
});
// Add Billing
snaptr('track', 'ADD_BILLING', {
'price': '149.99',
'currency': 'USD'
});
// Purchase
snaptr('track', 'PURCHASE', {
'price': '149.99',
'currency': 'USD',
'transaction_id': 'ORDER_12345',
'number_items': '3'
});
Dynamic Product Data
Pass detailed product information:
snaptr('track', 'PURCHASE', {
'currency': 'USD',
'price': '249.98',
'transaction_id': 'ORDER_12345',
'item_ids': ['SKU_001', 'SKU_002'],
'item_category': 'Electronics',
'brands': ['BrandA', 'BrandB'],
'number_items': '2',
'description': 'Wireless Headphones and Smart Watch',
'client_dedup_id': 'ORDER_12345_' + Date.now()
});
Conversion Tracking
Implementation Methods
1. Snap Pixel (Browser-Side)
Standard JavaScript implementation:
<!-- Base Pixel Code -->
<script type='text/javascript'>
(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()
{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};
a.queue=[];var s='script';r=t.createElement(s);r.async=!0;
r.src=n;var u=t.getElementsByTagName(s)[0];
u.parentNode.insertBefore(r,u);})(window,document,
'https://sc-static.net/scevent.min.js');
snaptr('init', 'YOUR_PIXEL_ID', {
'user_email': '__INSERT_USER_EMAIL__',
'user_phone_number': '__INSERT_USER_PHONE__'
});
snaptr('track', 'PAGE_VIEW');
</script>
<!-- Event Tracking -->
<script>
snaptr('track', 'PURCHASE', {
'currency': 'USD',
'price': '99.99'
});
</script>
2. Google Tag Manager
Deploy Snap Pixel via GTM:
// GTM Custom HTML Tag - All Pages
<script type='text/javascript'>
(function(e,t,n){if(e.snaptr)return;var a=e.snaptr=function()
{a.handleRequest?a.handleRequest.apply(a,arguments):a.queue.push(arguments)};
a.queue=[];var s='script';r=t.createElement(s);r.async=!0;
r.src=n;var u=t.getElementsByTagName(s)[0];
u.parentNode.insertBefore(r,u);})(window,document,
'https://sc-static.net/scevent.min.js');
snaptr('init', '{{Snapchat Pixel ID}}');
snaptr('track', 'PAGE_VIEW');
</script>
Event Tags:
// Purchase Event via GTM
<script>
snaptr('track', 'PURCHASE', {
'currency': 'USD',
'price': {{Transaction Value}},
'transaction_id': {{Transaction ID}},
'client_dedup_id': {{Dedup ID}}
});
</script>
3. Snapchat Conversions API
Server-side tracking for enhanced measurement:
// 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 conversionEvent = {
event_type: 'PURCHASE',
event_conversion_type: 'WEB',
event_tag: 'event_tag',
timestamp: Date.now(),
hashed_email: hashData('user@example.com'),
hashed_phone_number: hashData('+15551234567'),
hashed_ip_address: hashData('192.168.1.1'),
user_agent: 'Mozilla/5.0...',
price: '99.99',
currency: 'USD',
transaction_id: 'ORDER_12345',
item_category: 'Apparel',
item_ids: ['SKU_123', 'SKU_456'],
number_items: 2,
uuid_c1: 'unique_event_id_12345', // Click ID from _scid cookie
client_dedup_id: 'ORDER_12345'
};
const response = await axios.post(
'https://tr.snapchat.com/v2/conversion',
{
pixel_id: 'YOUR_PIXEL_ID',
event: [conversionEvent]
},
{
headers: {
'Authorization': `Bearer YOUR_ACCESS_TOKEN`,
'Content-Type': 'application/json'
}
}
);
4. App Event Tracking
For mobile app conversions via Snap SDK:
iOS (Swift):
import SCSDKCreativeKit
SCSDKSnapAPI.trackPurchase(
price: 99.99,
currency: "USD",
transactionId: "ORDER_12345",
success: { () in
print("Purchase tracked")
},
failure: { (error) in
print("Error: \(error)")
}
)
Android (Java):
import com.snap.creativekit.api.SnapCreative;
SnapCreative.getSnapAPI(context).trackPurchase(
99.99,
"USD",
"ORDER_12345"
);
Advanced Matching
Improve conversion matching with user data:
// Enhanced matching
snaptr('init', 'YOUR_PIXEL_ID', {
'user_email': hashEmail('user@example.com'), // SHA256 hash
'user_phone_number': hashPhone('+15551234567'),
'user_hashed_mobile_ad_id': hashMAID('advertising-id'),
'user_ipaddress': '192.168.1.1',
'user_agent': navigator.userAgent
});
function hashEmail(email) {
// SHA256 hash implementation
return CryptoJS.SHA256(email.toLowerCase().trim()).toString();
}
Event Deduplication
Prevent duplicate events when using Pixel + CAPI:
// Browser-side
const dedupId = 'ORDER_12345_' + Date.now();
snaptr('track', 'PURCHASE', {
'price': '99.99',
'currency': 'USD',
'transaction_id': 'ORDER_12345',
'client_dedup_id': dedupId
});
// Server-side CAPI with matching client_dedup_id
Offline Conversions
Conversions API for Offline Events
Upload offline conversions via CAPI:
import requests
import hashlib
import time
def hash_value(value):
return hashlib.sha256(value.lower().strip().encode()).hexdigest()
# Offline conversion event
event_data = {
"pixel_id": "YOUR_PIXEL_ID",
"event": [{
"event_type": "PURCHASE",
"event_conversion_type": "OFFLINE",
"timestamp": int(time.time() * 1000),
"hashed_email": hash_value("customer@example.com"),
"hashed_phone_number": hash_value("+15551234567"),
"price": "149.99",
"currency": "USD",
"transaction_id": "STORE_ORDER_12345",
"client_dedup_id": "STORE_ORDER_12345"
}]
}
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
response = requests.post(
"https://tr.snapchat.com/v2/conversion",
json=event_data,
headers=headers
)
Mobile Measurement Partners (MMPs)
Integrate with MMPs for app install and event tracking:
Supported MMPs:
- AppsFlyer
- Adjust
- Kochava
- Branch
- Singular
Benefits:
- Automatic app install attribution
- In-app event tracking
- Deep linking support
- Fraud prevention
- Cross-platform measurement
Attribution
Attribution Windows
Configure attribution settings per ad account:
Default Windows:
- Click-through (Swipe Up): 28 days
- View-through: 1 day
Customizable Options:
- 1-day, 7-day, or 28-day attribution windows
- Separate windows for different conversion events
Configure in: Snapchat Ads Manager > Settings > Attribution
Attribution Models
Snapchat uses last-touch attribution:
- Last swiped ad gets 100% credit
- If no swipe, last viewed ad gets credit (within view-through window)
Snap Pixel Attribution
Pixel provides:
- Swipe attribution - User swipes up on ad
- View attribution - User views ad, converts later
- Cross-device attribution - For logged-in Snapchat users
Conversion Lift Studies
Measure incremental impact via controlled testing:
Setup:
- Create conversion lift study in Ads Manager
- Define test and control groups
- Run campaign for minimum 2 weeks
- Measure incremental conversions
Best for:
- Brand awareness campaigns
- New product launches
- Measuring true ad impact
Debugging & Validation
Snap Pixel Helper
Chrome extension for validating Snap Pixel:
- Install Snap Pixel Helper extension
- Visit page with Snap Pixel
- Review:
- Pixel ID detected
- Events fired
- Parameters passed
- Errors or warnings
Test Events
Generate test events in Ads Manager:
- Navigate to Events Manager
- Select your pixel
- Click Test Events
- Enter test event code or use browser
- Generate events on your site
- View real-time event data
Events Manager
Monitor pixel health:
Ads Manager > Events Manager:
- Pixel status (active/inactive)
- Events received (last 24 hours, 7 days, 28 days)
- Event breakdown by type
- Top events by volume
Browser Console Debugging
Test Snap Pixel in console:
// Check if snaptr is loaded
if (typeof snaptr !== 'undefined') {
console.log('Snap Pixel loaded');
} else {
console.error('Snap Pixel not found');
}
// Check pixel queue
console.log(snaptr.queue);
// Fire test event
snaptr('track', 'PURCHASE', {
'price': '1.00',
'currency': 'USD',
'transaction_id': 'TEST_' + Date.now()
});
Common Issues
Pixel not firing:
- Verify Pixel ID is correct
- Check script loads before events
- Ensure no JavaScript errors
- Test in incognito mode
Events not appearing:
- Wait 15-30 minutes for processing
- Verify event name is correct (uppercase)
- Check required parameters included
- Review Events Manager for errors
Low match rates:
- Implement advanced matching with hashed data
- Use Conversions API for server-side tracking
- Include email and phone when available
- Verify hashing is SHA256
Best Practices
Implementation
- Install Snap Pixel on all pages for complete funnel tracking
- Use both Pixel and CAPI for redundancy and improved accuracy
- Implement advanced matching with user email and phone
- Use GTM for easier pixel management
- Include deduplication IDs for purchase events
Event Strategy
- Track full funnel (VIEW_CONTENT, ADD_CART, PURCHASE)
- Use standard event names (uppercase) for optimization
- Create separate pixels for different business units if needed
- Track micro-conversions for audience building
- Implement app events for mobile app campaigns
Data Quality
- Pass transaction_id for all purchase events
- Include price and currency for value optimization
- Use consistent item_ids format
- Send client_dedup_id to prevent duplicates
- Hash all PII using SHA256
Privacy & Compliance
- Implement consent management for GDPR/CCPA
- Hash PII before sending (email, phone)
- Use Snapchat's CCPA compliance features
- Update privacy policy to disclose Snapchat tracking
- Honor user opt-outs via platform controls
Optimization
- Use Goal-Based Bidding with pixel events
- Optimize to purchases for ecommerce campaigns
- Create lookalike audiences from converters
- Exclude converted users from top-of-funnel campaigns
- Test different attribution windows based on sales cycle
Creative Optimization
- Use Snap AR lenses to drive engagement
- Track video views as engagement events
- Optimize for mobile (vertical video, fast loading)
- Test different creative formats (Single Image, Story, Collection)
- Use dynamic ads for catalog retargeting
Mobile App Campaigns
- Integrate Snap SDK for app event tracking
- Use MMP for attribution and fraud prevention
- Track in-app events beyond install
- Implement deep linking for better UX
- Optimize to post-install events for quality users
Testing
- Use Snap Pixel Helper to verify implementation
- Generate test events before launch
- Verify events in Events Manager within 30 minutes
- Test deduplication with Pixel + CAPI
- Monitor pixel health for first 48 hours
Reporting
- Break down by placement (Snap feed vs Stories vs Discover)
- Segment by device (iOS vs Android)
- View swipe vs view conversions separately
- Track event trends over time
- Export data for external analysis
Gen Z Targeting
- Optimize for mobile-first experience
- Use vertical video creative (9:16 ratio)
- Keep messaging authentic and casual
- Track engagement events (shares, screenshot)
- Test AR experiences for higher engagement