Setup Steps
- Facebook Pixel automatically sets a first-party cookie (_fbp) to identify users across page views on the same domain.
- For cross-domain scenarios (e.g., main site to checkout subdomain or third-party payment processor), ensure the _fbp cookie value is passed and preserved.
- If using a third-party checkout or payment provider, coordinate with them to ensure fbp and fbc parameters are passed via URL or stored in session data.
- Implement server-side Conversions API to capture events on domains where pixel cannot fire due to security restrictions or consent limitations.
- Verify domain ownership in Meta Business Manager for all domains where pixel fires to avoid event attribution issues.
Passing fbp and fbc Between Domains
When a user navigates from one domain to another (e.g., example.com to checkout.example.com or external-payment.com), pass the Facebook browser cookie (fbp) and click ID (fbc) to maintain user identity:
- URL Parameter Method: Append fbp and fbc as query parameters when redirecting to another domain. On the source domain:
// Read Meta cookies and append to cross-domain links
function getMetaCookies() {
const cookies = document.cookie.split('; ');
const fbp = cookies.find(c => c.startsWith('_fbp='))?.split('=')[1] || '';
const fbc = cookies.find(c => c.startsWith('_fbc='))?.split('=')[1] || '';
return { fbp, fbc };
}
// Append to checkout redirect URL
document.querySelectorAll('a[href*="checkout.example.com"]').forEach(link => {
const { fbp, fbc } = getMetaCookies();
const url = new URL(link.href);
if (fbp) url.searchParams.set('fbp', fbp);
if (fbc) url.searchParams.set('fbc', fbc);
link.href = url.toString();
});
On the destination domain, read these parameters and set cookies or pass to Conversions API.
Server Session Method: Store fbp and fbc in server-side session storage when the user initiates checkout, then retrieve on the destination domain.
Conversions API Continuity: Send fbp and fbc from the original domain to your backend, then include them in Conversions API events for cross-domain actions (e.g., purchase on external payment provider).
Third-Party Payment Providers & Embedded Checkouts
- If using Stripe, PayPal, or other embedded checkout solutions, confirm they allow URL parameter passthrough or JavaScript callbacks to retrieve completion events.
- For providers that redirect to external domains, pass fbp, fbc, and event_id via URL parameters or secure tokens.
- Use Conversions API to send server-side Purchase events when the payment provider confirms the transaction, including the original fbp/fbc for user matching.
- Test the full checkout flow in Facebook Pixel Helper and Events Manager to confirm events fire correctly and user identity is preserved.
Subdomains & Cookie Sharing
- Facebook Pixel's _fbp cookie is scoped to the top-level domain by default (e.g., .example.com), so it automatically works across www.example.com and checkout.example.com.
- Verify the cookie domain setting if using a custom pixel implementation or server-side cookie management.
- For completely different domains (example.com to partner-checkout.com), use the URL parameter or CAPI method to bridge user identity.
Edge Cases
- When using iframes for embedded content, pixel events may not fire if third-party cookies are blocked; use Conversions API as a fallback.
- For mobile app-to-web transitions, use app event deferred deep links to pass user identity and ensure app events are sent with matching external_id or hashed email.
- If a user moves between regions or devices, rely on hashed email and external_id in Conversions API user_data to improve cross-device matching.
Validation
- Use Facebook Pixel Helper to check that _fbp cookie is present on all domains where pixel fires.
- Review Events Manager to confirm events from different domains are attributed to the same user journey.
- Test cross-domain flows in incognito/private mode to simulate new user sessions and verify cookie passing.
- Check Event Match Quality scores for cross-domain events to ensure sufficient user_data is being sent.
- Monitor Conversions API Diagnostics for errors related to missing fbp, fbc, or user_data fields.
Recommended Approach
For best results, implement a hybrid strategy:
- Client-side pixel on all owned domains with proper _fbp cookie sharing.
- Conversions API for cross-domain events where pixel cannot fire (third-party checkouts, server-side actions).
- URL parameter passing for fbp and fbc when redirecting between domains or to payment providers.
- Event deduplication using event_id to ensure the same conversion isn't counted multiple times across pixel and CAPI.