Pass real conversion data – calls booked, invoices sent, deals closed – back to Meta and Google so your campaigns optimize on revenue, not guesses.
- Best for: B2B companies running paid media on Meta or Google who use a CRM and want server-side conversion tracking without losing attribution when deals close offline.
- Tech stack: PostHog (as CDP) + CRM (HubSpot, Salesforce, High Level, Pipedrive) + Meta CAPI or Google Ads enhanced conversions.
- Setup time: 2–5 days for webhooks + CAPI routing; 2–4 weeks for a warehouse-backed implementation.
Why your Meta and Google ads optimize on the wrong conversions
Meta and Google know about your clicks. They might know about your form fills. They almost certainly do not know about your closed deals.
Here is why that is a problem:
- Bidding on the wrong conversions. Your campaigns optimize toward whoever clicks most – not whoever buys. CAC (customer acquisition cost: total ad spend divided by new customers acquired) climbs because the algorithm chases cheap clicks, not high-value buyers.
- ROAS data you cannot trust. Revenue happens in your CRM. Without a link between CRM events and your ad account, your ROAS (return on ad spend: revenue generated per dollar of ads) is always understated.
- Audiences built from the wrong people. Lookalike audiences built from form fills include everyone who was curious. Audiences built from closed deals include people who actually paid.
Connecting PostHog to your CRM fixes all three. Your click IDs flow from the first ad touch through to the final invoice, and every meaningful conversion reaches the ad platform automatically.
Why PostHog is the best way to connect your CRM to Meta and Google?
PostHog sits between your website, your product, and your ad platforms. It captures anonymous visitor data – including the fbclid (Facebook click ID: the unique ID Meta appends to ad traffic URLs, used to match conversions back to the campaign) — before a visitor ever identifies themselves. (Not yet running PostHog as your CDP? See our PostHog as a CDP guide first.)
When that visitor later submits a form and triggers a CRM contact, PostHog already has their click ID stored. posthog.identify() links the anonymous session to their email address, and now their entire journey – ad click, web behavior, and CRM activity – lives on one person profile.
That is the data you send to Meta via CAPI (Conversions API: Meta’s server-side event transmission system, which bypasses iOS 14+ browser tracking restrictions and ad blockers) to get credit for what you actually drove.
No CRM integration means no click ID attached to closed deals. Meta and Google never learn what your best-performing campaigns actually produce.
Step 1: How to set up PostHog Identify for accurate CRM attribution
identify is the function that links a PostHog anonymous visitor to a known contact. Without it, your CRM events arrive in PostHog as disconnected records – no ad click ID, no web history, no attribution.
The correct implementation:
- Fire
posthog.identify()the moment a visitor converts – form submit, login, email confirmation. - Pass their email address as the
distinct_idso PostHog can match it to incoming CRM events. - Use
posthog.alias()to merge the pre-submission anonymous session with the identified profile.
After this runs correctly, every CRM event that hits PostHog for that email address will automatically inherit the visitor’s fbclid, UTM parameters, referrer data, and page history.
This is the step most teams skip or get wrong. Fix it before you build anything else.
Step 2: How to send CRM events to PostHog using webhooks
Set up outbound webhooks in your CRM to fire when key events occur. Point them at PostHog’s event capture API endpoint. Include the contact’s email in every payload. Our PostHog workflows guide covers how to chain these events into automated follow-up actions.
Start with these four events:
- Lead created — fires when a form is submitted outside of your booking funnel. Carries the earliest attribution signal; often has the best click ID coverage.
- Call booked — fires when a prospect schedules a sales or discovery call. This is the highest-intent signal before a conversation occurs. If you use Calendly or a CRM-native scheduler, trigger the webhook on confirmation.
- Invoice sent — fires when your team sends a proposal or invoice. This is the first revenue-adjacent event. Sending it to Meta tells the algorithm which ad led to a serious buyer.
- Deal closed / won — fires when a deal closes. This is your actual ROAS event. If you send nothing else to your ad platform, send this.
Each event payload should include: email address, timestamp, deal value if available, and a unique event ID to prevent duplicates.
So you can close the gap between ad click and closed deal – in real time, automatically, without manual exports.
Need the webhook mapped to your specific CRM? Book a setup call with Vision Labs →
Step 3: How to route PostHog CRM events to Meta CAPI and Google Ads
Once CRM events live in PostHog with click IDs attached, you route them to your ad platforms.
Meta (Facebook) via CAPI:
PostHog’s data pipeline can forward events directly to Meta’s Conversions API. For each conversion event – call booked, invoice sent, deal closed – PostHog sends (see our full Meta CAPI setup guide for the complete configuration walkthrough):
- Event name (matching your Meta event setup)
- Email address (hashed)
fbc/fbclidvalue (for click-level matching)- Timestamp and event ID
Meta uses the fbc value to match the server-side event to the original ad click. The more milestones you send, the more the algorithm learns about your actual buyer profile.
Google Ads via enhanced conversions:
The same principle applies to Google. Enhanced conversions use first-party data (email address, hashed) to match offline conversions back to Google ad clicks. You send the conversion from PostHog when the CRM milestone fires.
Validation: After 48–72 hours, check your Meta Events Manager and Google Ads conversion dashboard. You should see server-side events appearing with a match quality score. A score above 7/10 in Meta indicates solid click ID coverage. Below 5 means identify or the click ID capture needs attention.
Step 4: How to build revenue-based audiences from PostHog CRM data
With closed-loop data in PostHog, you can build cohorts that actually reflect purchase behavior – and push them to your ad platforms as custom audiences. For a deeper look at how PostHog’s cohort and funnel tools work together, see our PostHog groups, funnels, and cohorts guide.
Three cohorts to build first:
Closed-deal cohort: Everyone who triggered deal_closed_won in the last 180 days. Use this as the seed audience for Meta and Google lookalike campaigns. These are your buyers, not your browsers.
High-intent non-converter cohort: Everyone who triggered call_booked but not deal_closed_won. Use this for retargeting. They raised their hand; something stopped them.
Pre-close engagement cohort: Everyone who visited your pricing page and triggered lead_created in the same session. High-intent signals that predict conversion.
So you can stop spending retargeting budget on low-intent visitors and direct it at the profiles that match your actual customers.
How to test if your PostHog CRM integration is working
Three checks inside PostHog confirm the loop is closed:
Check 1: Person profile completeness. Open any recent CRM contact in PostHog’s Persons view. You should see web events and CRM events on the same timeline. If CRM events appear without web history, identify is broken.
Check 2: Click ID coverage. Filter PostHog persons who triggered “Invoice Sent” in the last 30 days. Count how many carry an fbc or fbclid property. Aim for 60%+. Below that, you are losing attribution on a significant share of your conversions.
Check 3: Meta Events Manager match rate. Log into Meta Events Manager and check the match quality score for your server-side events. A high match rate (7+) confirms your click IDs and email hashes are reaching Meta correctly.
Which PostHog CRM integration option fits your company size?
- Early stage ($1M–$5M ARR):Webhooks via Zapier or Make, connected to PostHog’s API. No data engineer needed. Focus on four events: lead, call booked, invoice sent, deal closed. Estimated setup: 2–5 days.
- Growth stage ($5M–$30M ARR):Native CRM webhooks with a developer-implemented PostHog integration. Add historical data import. Begin routing events to Meta CAPI and Google enhanced conversions. Estimated setup: 2–3 weeks.
- Scale stage ($30M+ ARR):Warehouse-backed integration (BigQuery or Snowflake) with reverse ETL (Census, Hightouch) feeding PostHog. Full historical CRM data, row-level joins with product data, automated audience syncs. Estimated setup: 3–6 weeks with a data engineer.
PostHog CRM integration: common questions
What if my CRM does not support native webhooks?
Zapier and Make both connect to most CRMs and can forward events to PostHog’s HTTP API. No code required.
Do I need to be using PostHog as my CDP to do this?
No. If you run PostHog alongside Segment or another CDP, you can route CRM events through your existing pipeline to PostHog as a destination. The identify setup still applies.
What happens if a contact converts on mobile, where click IDs often get dropped?
PostHog captures the fbc cookie on the first session. If it is set before the iOS browser session closes, it persists. Email-based matching in CAPI handles the remaining share – Meta’s algorithm can match on hashed email even without a click ID.
How do I prevent duplicate events from reaching Meta?
Pass a unique event_id in every webhook payload. Both PostHog and Meta’s CAPI use this ID for deduplication – if the same event arrives via browser pixel and server side, only one gets counted.
What does a professional setup cost?
Webhook-first implementations with CAPI routing run $4k–$10k. Full warehouse-backed setups with custom audience syncs run $10k–$25k depending on CRM complexity and data volume.
Is the PostHog CRM integration worth building?
Your CRM and your ad platforms are not connected. PostHog connects them.
Get identify right. Set up webhooks for your four core CRM events. Route those events to Meta and Google. Build cohorts from your actual buyers.
Do those four things and your ad campaigns start optimizing on revenue – not clicks.
Want the full loop built and validated for your stack? Book a PostHog implementation review with Vision Labs →