Meta CAPI
Learn how you can send conversion data to Meta Conversions API via server-side Google Tag Manager for better ad optimization accuracy
Send Hardal analytics data to Meta Conversions API using server-side Google Tag Manager for improved ad optimization and measurement accuracy.
Make sure to check the partner's website and API documentation for the most up-to-date information and configurations.
Set Up Server-Side GTM
Complete the Server-side Google Tag Manager setup first.
Configure Meta Browser & Click IDs
In your web container, create User-Defined Variables:
- Meta Browser ID: 1st-Party Cookie with name
_fbp - Meta Click ID: 1st-Party Cookie with name
_fbc
Add these to your GA4 Configuration tag as custom fields:
x-fb-ck-fbp: Meta Browser ID variablex-fb-ck-fbc: Meta Click ID variable
Set Up User Data Variables
Create Data Layer Variables for user matching:
- Email:
eventModel.user_data.email_address - Phone:
eventModel.user_data.phone_number - First Name:
eventModel.user_data.address.first_name - Last Name:
eventModel.user_data.address.last_name
Add Meta CAPI Tag
- In server container, search Community Template Gallery for "Meta Conversions API"
- Configure with your Meta Pixel ID and Access Token
- Map user data variables for enhanced matching
- Enable automatic event deduplication
Create Event Triggers
Set up triggers for Meta standard events:
- PageView → page_view
- Purchase → purchase
- AddToCart → add_to_cart
- Lead → generate_lead
- CompleteRegistration → sign_up
Test Implementation
- Enable Preview mode in both containers
- Trigger events on your website
- Verify Meta CAPI tag fires and sends data to Meta
- Check Meta Events Manager for successful delivery