Overview
This Stripe connection allows you to enhance your ad performance and attribution on Meta.How It Works
When a customer completes an action in Stripe (e.g., a purchase, renewal, upgrade, etc.), our system securely processes this event and forwards it to Meta’s Conversions API for improved ad attribution.Prerequisites
Before setting up the integration, you’ll need:- A Stripe account with webhook access
- Meta Pixel ID
- Meta Access Token
- Meta Pixel set up on your landing page and app
Step 1: Provide Meta Pixel Settings
- Meta Pixel ID: Find this in your Meta Events Manager
- Meta Access Token: Generate this in your Meta Business Settings under System Users
Step 2: Set Up Webhook
Configure a webhook endpoint in your Stripe Dashboard to enable automatic event forwarding:- Go to Stripe Webhooks
- Click Add endpoint
- Enter webhook URL:
https://meta-tracking.loops.fi/api/chatbase/webhooks/stripe - Select all events or choose specific events you want to track
- Copy the webhook signing secret for later use
Step 3: Enhance Your Data with Customer Metadata
To help Meta accurately attribute conversions to your ads, you need to send additional customer data. This data is collected in two ways:Server-Side Data: IP Address and User Agent
Your server automatically receives the customer’s IP address and user agent with every API request. Extract these values and include them when creating a Stripe Customer:Client-Side Data: _fbc and _fbp Cookies
These cookies are stored in the user’s browser by Meta. Your website’s frontend JavaScript needs to read these cookies and send them to your backend.
Get cookies on the client side:
Add this helper function to your client-side JavaScript:
Putting It All Together
Your server will now receive all the necessary information. Here’s how to combine it and create a Stripe Customer with all the Meta CAPI metadata:customer.created or checkout.session.completed webhook is triggered, the associated Stripe Customer will contain all the required Meta CAPI metadata for improved ad attribution.
Next Steps
Once configured, your Stripe conversion events will automatically be sent to Meta’s Conversions API, helping you:- Improve ad targeting accuracy
- Measure campaign performance more effectively
- Optimize your ad spend based on actual conversion data

