Send Stripe revenue to Meta Ads with n8n and the Conversions API
Product-led SaaS teams running Meta ads to a free trial or freemium signup, with Stripe Billing as the source of truth for who pays and how much.
- Stripe
- n8n
- Meta Ads
- Tools
- Stripe, n8n and Meta Ads
- Tool cost
- Mostly usage or quote based, plus Stripe, n8n and Meta Ads
- It moves
- Qualified conversions and expected revenue the ad platforms can bid on
What does this playbook get you?
- Every paid lead carries its click ID (gclid, gbraid, wbraid, fbc or li_fat_id) and a consent flag from the first form fill to the closed deal.
- Qualified, opportunity and closed-won stages land in each ad platform within a day, with a value tied to what that stage is worth.
- Bidding runs on a primary conversion that is a qualified stage, not a raw form fill, once enough volume has built up.
- A weekly check shows upload errors, match quality and conversion counts next to CRM counts, so drift gets fixed before it skews bids.
- Leads who did not consent are never sent, and EEA uploads carry the ad_user_data and ad_personalization signals.
Who should pick something else?
Teams that sell through a sales-led contract with invoices outside Stripe, or that can't change the signup flow to store click data on the subscription.
Which tools does this stack use, and what do they cost?
| Tool | Role | List price |
|---|---|---|
| Stripe | CRM or billing system | Usage-based (opens in a new tab) |
| n8n | Sync layer | See the pricing page (opens in a new tab) |
| Meta Ads | Meta Ads | Usage-based (opens in a new tab) |
Prices from each vendor's own pricing page, checked 2026-11-28. Plans change, so confirm before you buy.
How does data move through this stack?
- StripeCRM or billing system
- n8nSync layer
- Meta AdsMeta Ads
How do you build it?
How do you set up the CRM or billing system to hold click IDs and stages in Stripe?
- At signup, read fbc (the _fbc cookie, or build it as fb.1.<time>.<fbclid> from the URL), the user agent and the signup page URL, plus the consent choice.
- Write them to the Stripe Customer's metadata (keys like fbc, client_user_agent, signup_url, ad_consent). Metadata allows 50 keys of up to 500 characters each.
- If you use Checkout, also set subscription_data.metadata so the values ride on the Subscription and show up on its invoices.
- Add a webhook endpoint that listens to invoice.paid, and note each invoice's billing_reason: subscription_create is a new customer, subscription_cycle is a renewal.
Watch for: Metadata does not copy between objects on its own, so an fbc saved only on the Checkout Session never reaches the invoice.
| From | To | Why |
|---|---|---|
_fbc cookie | Customer metadata fbc | Case sensitive; never lowercase or trim the click ID. |
Invoice amount_paid | value | Stripe amounts are in the minor unit (1000 is 10 USD), so convert before sending. |
Invoice id | event_id | A stable ID Meta can use to drop duplicates. |
How do you set up the sync layer that moves stages to the ad platforms in n8n?
- Add a Stripe Trigger node for invoice.paid and set a Signature Secret on the Stripe credential so forged or stale requests get a 401.
- Add an IF node that keeps invoices with billing_reason subscription_create and an ad_consent value of yes in the customer metadata.
- Add a Crypto node set to Hash, type SHA256, encoding HEX, on the email after you trim and lowercase it.
- Add an HTTP Request node that POSTs to graph.facebook.com/{version}/{dataset_id}/events with the event in data and your access token.
- Add an error workflow that writes failed events to a sheet so you can resend them inside the 7 day window.
Watch for: A workflow that stops for a week loses those events for good, because Meta rejects any batch with an event older than 7 days.
| From | To | Why |
|---|---|---|
Invoice id | event_id | Lets Meta drop a duplicate if the pixel also fired. |
Hashed email | user_data.em | SHA-256 hex of the trimmed, lowercased email. |
Customer metadata fbc | user_data.fbc | Sent as is, never hashed. |
How do you set up Meta Ads to receive CRM and revenue events in Meta Ads?
- In Events Manager, open your dataset (pixel), go to Settings and generate a Conversions API access token for the sync.
- Decide the event names you will send: Purchase with value and currency for revenue, or one free-form event per CRM stage for lead ads leads.
- Use the Test events tab to get a test_event_code, send a few events with it, then remove it before you go live.
- For lead ads, set the campaign's optimization to Conversion Leads so Meta trains on the CRM stages you send.
- For California users who opt out, send data_processing_options set to LDU with country 1 and state 1000.
Watch for: Any event older than 7 days fails the whole batch it sits in, so one stale row can block a full day of uploads.
How do Stripe and n8n connect?
Paste the n8n Stripe Trigger webhook into Stripe, or let the node register it, and pick invoice.paid as the event.
Stripe copies a subscription's metadata onto each invoice it creates, under parent.subscription_details.metadata, so the fbc, user agent and consent you saved at signup arrive inside the invoice.paid event.
Stripe gives amounts in the minor unit and currency codes in lowercase, so divide amount_paid by 100 for USD and uppercase the code before it goes to Meta.
How do n8n and Meta Ads connect?
Send a Purchase event with event_time as the paid time in Unix seconds, action_source website, event_source_url and client_user_agent from metadata, and value and currency in custom_data.
Put the hashed email in em and the raw fbc in fbc, and use the invoice ID as event_id.
Meta takes up to 1,000 events in one request, far more than a single paid invoice needs.
What numbers should this playbook move?
The formula: Matched qualified conversions = paid clicks x click-to-lead rate x lead-to-qualified rate x match rate
- Click ID capture moves match rate. Fire the Conversion Linker and fill hidden fields on every paid landing page, and carry the ID across lead conversion, so more records arrive with a click ID.
- Hashed email and phone moves match rate. Send normalized, hashed email and phone with every event so records that lost the click ID can still match.
- Which stage you send moves signal quality and volume. Pick the earliest stage that still predicts revenue, so you get enough weekly conversions without training on junk.
- Value per stage moves value-based bidding. Send the expected value of a stage (deal size x close rate from that stage), and the real amount on closed-won.
- Upload freshness moves rejected and late events. Sync at least daily so you stay inside Meta's 7 days, Google's 63 or 90 days and LinkedIn's 90 days.
What does the math look like for this stack?
A worked example, not a benchmark. Swap in your own numbers.
| Example input | Value |
|---|---|
| Paid clicks a month | 8,000 |
| Click to form fill or signup | 6% |
| Form fill to qualified (SQL, opportunity or paid) | 10% |
| Qualified to closed-won | 100% |
| Average first-year deal value | $1,200 |
| Qualified conversions the platform matches | 65% |
| Result | Value |
|---|---|
| Form fills or signups a month | 480 |
| Qualified conversions a month | 48 |
| Matched qualified conversions a week | 7 |
| Value to send per qualified conversion | $1,200 |
| Expected revenue behind matched uploads a month | $37,440 |
| Tool cost per matched qualified conversion | $0 |
- This is a worked example. Every input is an assumption you should replace with your own funnel numbers.
- Value per qualified conversion is deal value times close rate from that stage, the fixed value I would enter where a platform takes one value per event.
- Match rate stands for the share of uploads a platform ties to an ad click or account; each platform reports it differently, and some do not report it at all.
- Google says enhanced conversions help most at 20 or more conversions a week, so compare the weekly row to that before you switch bidding to the qualified stage.
- It leaves out ad spend, renewals, refunds and any lift from better bidding, which only your own before and after test can show.
Why pick this stack?
For a product-led company running Meta ads to a free trial, the signup is the wrong thing to optimize. Plenty of people start a trial and never add a card. The revenue signal is the first paid invoice in Stripe, and n8n can turn each one into a Purchase on Meta's Conversions API seconds after Stripe fires invoice.paid. Meta then bids for people who pay, with the real amount attached.
The hard part happens at signup, not in n8n. Stripe knows nothing about the ad click, so your app has to read the _fbc cookie (or build fbc from fbclid), the user agent, the page URL and the consent choice, and save them to the Subscription through subscription_data.metadata. Stripe copies subscription metadata onto each invoice under parent.subscription_details.metadata, so the workflow can send website-grade data without a second lookup.
The 7-day window shapes the design. Meta accepts events up to 7 days old and fails the whole request if one is older. A trial that converts on day 14 is fine, because the event time is the payment. A broken workflow that sits for a week is not. I add an error workflow that logs failed sends to a sheet, and I send one event per request, so a single bad payload can't sink others. Then I read the execution list every Monday, the same way I'd check a failed payment queue.
Why n8n over a no-code tool here: you need SHA-256 hashing, a filter on billing_reason and a raw HTTP call with nested JSON, and n8n covers all three with its Crypto, IF and HTTP Request nodes. You can self-host it or use n8n Cloud, where each run counts as an execution. Set the Signature Secret on the Stripe credential, or anyone holding the webhook URL can post fake purchases.
Decide early what counts. I send subscription_create invoices as Purchase with action_source website and skip subscription_cycle renewals at first, so Meta learns from new customers, not renewals it didn't drive. The invoice ID becomes event_id, so a pixel Purchase on the success page dedupes against it. Event Match Quality in Events Manager scores web events, so this setup gets a number you can watch each week.
What breaks, and how do you fix it?
| What breaks | The fix |
|---|---|
| Click IDs never reach the CRM because a form, redirect or iframe drops the URL parameters. | Store gclid, gbraid, wbraid, fbclid and li_fat_id in first-party cookies through Google Tag Manager and fill hidden fields from the cookie, not the URL. |
| Google rejects uploads with Conversion date precedes click date. | Send the stage time with its time zone offset, check the account time zone, and never send the CRM create date by mistake. |
| Uploads arrive before Google has processed the click and fail with a retry-in-12-hours error. | Delay uploads a few hours after the stage change and resend failed rows on the next run. |
| One deal shows up as two or three conversions. | Send a stable transaction ID, order ID or event_id per stage change, so retries and resyncs are dropped as duplicates. |
| Uploads carry no consent, or consent from the wrong user. | Store consent on the record at capture, filter non-consenting records out of every sync, and send ad_user_data and ad_personalization for EEA users. |
| Bids swing after switching the primary conversion to a qualified stage. | Run the qualified action as secondary first, wait the longer of 3 conversion cycles or 4 weeks, then swap. |
Questions about this stack
Should Stripe renewals go to Meta as well?
Not at first. Renewals mostly come from the product, and sending them teaches Meta that old customers are fresh conversions. If you want lifetime value in reporting later, send subscription_cycle invoices as a separate event with action_source system_generated, which Meta lists for automatic conversions such as subscription renewals, and keep Purchase for new money only.
How should the workflow treat EEA and California users?
Only send events where the consent flag stored at signup says yes, and drop the rest in the IF node. For California users who opted out, add data_processing_options with LDU, country 1 and state 1000, which tells Meta to apply Limited Data Use. The workflow can only enforce what your app recorded, so test the banner before the ads go live.
How does n8n handle Stripe amounts and currency codes?
Stripe gives amount_paid in the currency's minor unit, so 4900 means 49 USD, and it writes currency codes in lowercase. Divide by 100 for two-decimal currencies, leave zero-decimal ones such as JPY alone, and uppercase the code before it goes into custom_data. Send amount_paid instead of the list price so discounts and coupons are reflected.
What if a Stripe customer signed up without any Meta click data?
Then the subscription has no fbc, and the Purchase matches on the hashed email, user agent and signup URL alone. Meta still takes the event, but Event Match Quality depends on which customer details arrive, so expect a lower score for those rows. The device a customer pays on doesn't matter, because the click data was saved when the trial started.
Do I still need the pixel or Google tag if I send conversions from the CRM?
Yes. The tag and the Conversion Linker are what capture the click ID and user data on the first visit. The CRM upload only works if that first visit left something to match on, and Google's enhanced conversions for leads expects the tag to collect hashed user data on the site.
What changed with the Google Ads API for offline imports in 2026?
Starting June 15, 2026, offline conversion imports and enhanced conversions for leads uploads moved to the Data Manager API and are blocked in the Google Ads API, except for developer tokens Google allowlisted for legacy access. Tools like Hightouch moved syncs to Data Manager API OAuth. If you built your own upload script, check that it calls the Data Manager API.
Which stage should be my primary conversion?
Pick the earliest stage that sales agrees predicts revenue and that fires often enough to train on. For most B2B teams that is the sales-qualified lead or opportunity. Closed-won is the truest signal but often too rare and too late for bidding to learn from it.
How do I check match rates?
Google shows data quality under Goals > Summary in the offline data diagnostics and the enhanced conversions for leads diagnostics. Meta shows Event Match Quality in Events Manager for web events. LinkedIn shows conversion status in Campaign Manager. Each week, compare each platform's count against the CRM count for the same stage.
Want us to build this?
We can set up offline conversion sync on Stripe, n8n and Meta Ads for you: Stripe, n8n and Meta Ads connected in your own accounts, tested with real records and handed over with a short guide your team can follow. You'll know it works because qualified conversions and expected revenue the ad platforms can bid on is tracked from the first week.
Most builds like this are a flat-fee Done-for-you Playbooks install. Tell us your stack on a short call and you'll leave with a fixed scope and price.
Sources
- Tag Manager Help: Conversion linker (opens in a new tab)
- Meta: Conversions API server event parameters (opens in a new tab)
- Meta: Customer information parameters (opens in a new tab)
- Meta: fbp and fbc parameters (opens in a new tab)
- Meta: Using the Conversions API (opens in a new tab)
- Meta: Conversions API for CRM payload specification (opens in a new tab)
- Meta: Dataset Quality API (opens in a new tab)
- LinkedIn: Conversions API (opens in a new tab)
- LinkedIn: Click ID (li_fat_id) (opens in a new tab)
- n8n: Stripe Trigger node (opens in a new tab)
- n8n: Crypto node (opens in a new tab)
- Stripe: Metadata (opens in a new tab)
- Stripe: Event types (opens in a new tab)
- Stripe: The Invoice object (opens in a new tab)
- Stripe: Supported currencies and amounts (opens in a new tab)
Free to copy, and staying free
If this saved your team a build, an optional $5 tip helps cover what it costs to keep these current. Nothing unlocks, and every template and playbook stays free.
Startup? Let's talk.
20 minute fit call. You'll leave knowing the first thing we'd fix and roughly what it costs. If we're not the right fit, we'll tell you who is.