Meta Ads Integrations | Blue Frog Docs

Meta Ads Integrations

Integrations linking Meta Ads with analytics platforms, CRMs, and data tools.

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:

Key features:

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:

  1. Install Meta Sales Channel from Shopify App Store
  2. Connect Facebook Business Manager
  3. Configure Pixel and Conversions API automatically
  4. 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:

  1. Install "Facebook for WooCommerce" plugin
  2. Connect to Facebook Business Manager
  3. Configure Pixel settings
  4. 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:

  1. Install Meta Ads app from BigCommerce marketplace
  2. Connect Business Manager
  3. Configure Pixel and product catalog

CRM Integrations

HubSpot

Integration methods:

  1. Offline Conversions:

    • Upload customer data to Meta
    • Match with Facebook users
    • Attribute conversions
  2. 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:

  1. Export data from Salesforce
  2. Format as offline conversion file
  3. Upload to Meta Events Manager
  4. 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:

  1. Use UTM parameters in Meta Ads
  2. Import conversions from GA to Meta (via offline conversions)
  3. 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:

  1. Create Facebook Pixel tag
  2. Add Pixel ID
  3. Configure triggers (All Pages, Purchase, etc.)
  4. 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:

  1. Manual upload (CSV/XML)
  2. Scheduled feed
  3. API integration
  4. Platform connectors (Shopify, WooCommerce)

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:

  1. Enable in Events Manager
  2. Configure partner tool
  3. 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:

  1. Verify domain ownership
  2. Submit business documents
  3. 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:

  1. Navigate to Events Manager → Test Events
  2. Enter test code
  3. Generate events on your site
  4. 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)
// SYS.FOOTER