Overview
This guide covers the key integrations available for Meta Ads (Facebook & Instagram), helping you connect your advertising data with analytics platforms, ecommerce systems, CRMs, and other marketing tools.
Native Meta Integrations
Meta Pixel (JavaScript SDK)
Client-side tracking for website events:
<!-- Meta Pixel Base Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>
Use cases:
- Website visitor tracking
- Standard event tracking (ViewContent, AddToCart, Purchase)
- Custom conversions
- Audience building
Key features:
- Automatic Advanced Matching
- Event deduplication
- Real-time data collection
Conversions API (CAPI)
Server-side tracking for reliable, privacy-compliant data:
// Node.js example
const bizSdk = require('facebook-nodejs-business-sdk');
const ServerEvent = bizSdk.ServerEvent;
const EventRequest = bizSdk.EventRequest;
const UserData = bizSdk.UserData;
const CustomData = bizSdk.CustomData;
const access_token = 'YOUR_ACCESS_TOKEN';
const pixel_id = 'YOUR_PIXEL_ID';
const api = bizSdk.FacebookAdsApi.init(access_token);
const current_timestamp = Math.floor(new Date() / 1000);
const userData = (new UserData())
.setEmail('user@example.com')
.setPhone('1234567890')
.setClientIpAddress('192.168.1.1')
.setClientUserAgent('Mozilla/5.0...');
const customData = (new CustomData())
.setCurrency('USD')
.setValue(99.99);
const serverEvent = (new ServerEvent())
.setEventName('Purchase')
.setEventTime(current_timestamp)
.setUserData(userData)
.setCustomData(customData)
.setEventSourceUrl('https://example.com/checkout')
.setActionSource('website');
const eventsData = [serverEvent];
const eventRequest = (new EventRequest(access_token, pixel_id))
.setEvents(eventsData);
eventRequest.execute();
Benefits:
- Works with browser restrictions (iOS 14+, ad blockers)
- More accurate attribution
- Better data quality
- GDPR/privacy compliant
Recommended setup:
- Pixel + CAPI together for redundancy
- Use event_id for deduplication
- Server events for critical conversions
Meta Business Suite
Centralized management for:
- Ad accounts
- Pages
- Instagram accounts
- Pixel and Catalogs
- Audience insights
- Attribution settings
Access: business.facebook.com
Ecommerce Platform Integrations
Shopify
Setup:
- Install Meta Sales Channel from Shopify App Store
- Connect Facebook Business Manager
- Configure Pixel and Conversions API automatically
- Sync product catalog
Features:
- Automatic Pixel installation
- Server-side Conversions API
- Product catalog sync
- Order tracking
- Customer data sync
Code example (manual Pixel events):
<!-- Shopify Liquid template -->
{% if template == 'product' %}
<script>
fbq('track', 'ViewContent', {
content_ids: ['{{ product.id }}'],
content_type: 'product',
value: {{ product.price | money_without_currency }},
currency: '{{ cart.currency.iso_code }}'
});
</script>
{% endif %}
WooCommerce
Setup:
- Install "Facebook for WooCommerce" plugin
- Connect to Facebook Business Manager
- Configure Pixel settings
- Sync product catalog
Features:
- Pixel integration
- Product catalog sync
- Order tracking
- Custom audiences from customers
Magento
Integration options:
- Facebook Business Extension for Magento
- Custom implementation via Pixel and CAPI
Example Pixel integration:
// Magento 2 template
<script>
fbq('track', 'Purchase', {
value: <?php echo $order->getGrandTotal(); ?>,
currency: '<?php echo $order->getOrderCurrencyCode(); ?>',
content_ids: <?php echo json_encode($productIds); ?>,
content_type: 'product'
});
</script>
BigCommerce
Setup:
- Install Meta Ads app from BigCommerce marketplace
- Connect Business Manager
- Configure Pixel and product catalog
CRM Integrations
HubSpot
Integration methods:
Offline Conversions:
- Upload customer data to Meta
- Match with Facebook users
- Attribute conversions
Custom Audiences:
- Sync contact lists from HubSpot
- Create lookalike audiences
- Retargeting campaigns
Setup:
- Use HubSpot-Facebook integration
- Or custom API integration via CAPI
Salesforce
Integration via Offline Conversions:
// CSV upload format
email,phone,fn,ln,country,value,currency,event_name,event_time
user@example.com,1234567890,John,Doe,US,99.99,USD,Purchase,1640000000
Steps:
- Export data from Salesforce
- Format as offline conversion file
- Upload to Meta Events Manager
- Map to Meta Pixel events
Zapier Integration
Connect Meta Ads with 5000+ apps:
Example workflows:
- New CRM lead → Add to Meta Custom Audience
- Form submission → Track custom conversion
- Purchase in Stripe → Send CAPI event
Analytics Platform Integrations
Google Analytics
Setup:
- Use UTM parameters in Meta Ads
- Import conversions from GA to Meta (via offline conversions)
- Compare attribution models
UTM tagging:
https://example.com/product?
utm_source=facebook&
utm_medium=cpc&
utm_campaign={{campaign.name}}&
utm_content={{adset.name}}&
utm_term={{ad.name}}
Segment
Integration via Segment Destinations:
// Track purchase in Segment
analytics.track('Order Completed', {
order_id: '12345',
total: 99.99,
currency: 'USD',
products: [...]
}, {
integrations: {
'Facebook Pixel': true,
'Facebook Conversions API': true
}
});
Benefits:
- Single tracking implementation
- Send to Pixel and CAPI simultaneously
- Event normalization
Google Tag Manager
Pixel implementation via GTM:
- Create Facebook Pixel tag
- Add Pixel ID
- Configure triggers (All Pages, Purchase, etc.)
- Enable Enhanced Ecommerce mapping
Example Purchase event:
// dataLayer push
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'purchase': {
'actionField': {
'id': 'T12345',
'revenue': '99.99',
'currency': 'USD'
},
'products': [{
'id': 'P12345',
'name': 'Product Name',
'price': '99.99',
'quantity': 1
}]
}
}
});
// GTM tag maps to Meta Pixel
fbq('track', 'Purchase', {
value: '99.99',
currency: 'USD',
content_ids: ['P12345']
});
Product Catalog Integrations
Catalog Setup
Methods:
Feed format:
id,title,description,availability,condition,price,link,image_link,brand
SKU123,Widget Pro,Description here,in stock,new,99.99 USD,https://...,https://...,BrandName
Dynamic Product Ads
Requirements:
- Product catalog configured
- Meta Pixel with ViewContent, AddToCart, Purchase
- Product IDs match catalog
Pixel implementation:
// Product detail page
fbq('track', 'ViewContent', {
content_ids: ['SKU123'],
content_type: 'product',
value: 99.99,
currency: 'USD'
});
// Add to cart
fbq('track', 'AddToCart', {
content_ids: ['SKU123'],
content_type: 'product',
value: 99.99,
currency: 'USD'
});
Advanced Features
Conversions API Gateway
Simplified server-side tracking:
Benefits:
- No custom server code needed
- Automatic event forwarding
- Partner integrations (Google Tag Manager Server-Side)
Setup:
- Enable in Events Manager
- Configure partner tool
- Send events via partner platform
Offline Conversions
Upload offline sales data:
Use cases:
- In-store purchases
- Phone orders
- Sales pipeline conversions
Upload methods:
- CSV upload via Events Manager
- API integration
- CRM connector
Advanced Matching
Improve conversion attribution:
// Enable Advanced Matching
fbq('init', 'YOUR_PIXEL_ID', {
em: 'user@example.com', // Email
fn: 'john', // First name
ln: 'doe', // Last name
ph: '1234567890', // Phone
ct: 'menlopark', // City
st: 'ca', // State
zp: '94025', // Zip
country: 'us' // Country
});
Benefits:
- Better match rates
- Improved attribution
- Larger custom audiences
Compliance & Security
Business Verification
Required for:
- Ads with age restrictions
- Higher spending limits
- Advanced features
Process:
- Verify domain ownership
- Submit business documents
- Await approval (typically 2-5 business days)
Data Privacy
Requirements:
- Privacy policy on website
- Cookie consent (GDPR)
- Data Processing Agreement
- Limited Data Use (for CAPI)
CAPI compliance:
// Set data processing options
const serverEvent = (new ServerEvent())
.setEventName('Purchase')
.setDataProcessingOptions(['LDU'])
.setDataProcessingOptionsCountry(1)
.setDataProcessingOptionsState(1000);
Access Management
Best practices:
- Use Business Manager for access control
- Assign minimum required permissions
- Regular access audits
- Remove former employees/partners
- Use two-factor authentication
Testing & Debugging
Test Events
Use Test Events tool in Events Manager:
- Navigate to Events Manager → Test Events
- Enter test code
- Generate events on your site
- Verify events appear in real-time
Pixel Helper
Install Meta Pixel Helper Chrome extension:
- Verify Pixel is firing
- Check event parameters
- Identify errors
CAPI Event Testing
# Test CAPI event
curl -X POST 'https://graph.facebook.com/v18.0/YOUR_PIXEL_ID/events' \
-H 'Content-Type: application/json' \
-d '{
"data": [{
"event_name": "Purchase",
"event_time": 1640000000,
"action_source": "website",
"user_data": {
"em": "7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068"
},
"custom_data": {
"currency": "USD",
"value": 99.99
}
}],
"access_token": "YOUR_ACCESS_TOKEN"
}'
Best Practices
Pixel + CAPI Together
Recommended setup:
- Install Pixel for all events
- Implement CAPI for critical conversions (Purchase, Lead)
- Use same event_id for deduplication
// Client-side (Pixel)
const eventID = 'event_' + Date.now() + '_' + Math.random();
fbq('track', 'Purchase', {...}, {eventID: eventID});
// Server-side (CAPI) - use same eventID
const serverEvent = (new ServerEvent())
.setEventName('Purchase')
.setEventId(eventID) // Deduplication
.setUserData(userData)
.setCustomData(customData);
Event Naming
Standard events (use when possible):
- ViewContent
- AddToCart
- InitiateCheckout
- AddPaymentInfo
- Purchase
- Lead
- CompleteRegistration
Custom events:
- Use for non-standard actions
- Clear, descriptive names
- Consistent naming convention
Data Quality
Ensure:
- Accurate currency codes
- Valid email hashes (SHA-256)
- Consistent product IDs
- Complete user data
- Event timestamps in Unix format
Integration Checklist
- Meta Pixel installed on all pages
- Conversions API set up for critical events
- Event deduplication configured (event_id)
- Product catalog connected (if applicable)
- Advanced Matching enabled
- Privacy policy updated
- Business verification completed
- Access permissions configured
- Test events verified
- Analytics integration configured
- CRM integration set up (if applicable)
- Dynamic ads enabled (if applicable)