Automate offline conversion tracking across platforms
When a Salesforce deal closes won, its contact is sent to Facebook, LinkedIn and TikTok as a conversion, so your ad platforms learn from real revenue.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/send-offline-conversions-to-facebook-linkedin-tiktok/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Marketing · Advertising ppc
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/send-offline-conversions-to-facebook-linkedin-tiktok
Set it up with the CLI
- Add it. Copies the folder into
zaps/send-offline-conversions-to-facebook-linkedin-tiktok/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/send-offline-conversions-to-facebook-linkedin-tiktok - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy send-offline-conversions-to-facebook-linkedin-tiktok - Check it. Its recent runs, with status and errors.
npx zap-pack logs send-offline-conversions-to-facebook-linkedin-tiktok
zaps/send-offline-conversions-to-facebook-linkedin-tiktok/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 6 to fill in
- connections/facebook-conversions.tsThe
facebook-conversionsaccount it uses - connections/linkedin-conversions.tsThe
linkedin-conversionsaccount it uses - connections/salesforce.tsThe
salesforceaccount it uses - connections/tiktok-conversion.tsThe
tiktok-conversionaccount it uses - triggers/updated-record.tsWhat starts it:
salesforceupdated_record - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a Salesforce opportunity is updated (
salesforce,updated_record, withobjectset toOpportunity). - Filter: the run continues only if the opportunity's stage is
Closed Won. Anything else stops quietly. - Salesforce finds the first contact on the opportunity's account and takes its email. If there is no contact or no email, the run stops quietly.
- Facebook, LinkedIn and TikTok each receive one conversion for the contact, one after another. Every conversion carries the opportunity's ID as its event ID, so a deal that is updated again is counted once on each platform.
Ask the user
Each REPLACE_… value is set per person. Look up IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | What goes there |
|---|---|
FACEBOOK_BUSINESS_ID |
The Meta business account that sends the conversions. Look it up with the user's Facebook Conversions connection. |
FACEBOOK_PIXEL_ID |
The Meta pixel that receives them. Look it up with the same connection. |
LINKEDIN_ACCOUNT_ID |
The LinkedIn ad account that sends the conversions. Look it up with the user's LinkedIn Conversions connection. |
LINKEDIN_CONVERSION_ID |
The LinkedIn conversion rule that counts a closed deal. Look it up with the same connection. |
TIKTOK_ADVERTISER_ID |
The user's TikTok advertiser ID, shown in TikTok Ads Manager. |
TIKTOK_CRM_EVENT_SET_ID |
The CRM event set TikTok created for Salesforce, listed under the CRM events in TikTok Ads Manager. |
Also review the defaults with the user:
CLOSED_WON_STAGE: the opportunity stage value that counts as a won deal. Change it if the user's pipeline names it differently.CLOSED_WON_EVENT_NAME: the name the conversion carries on every platform.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/send-offline-conversions-to-facebook-linkedin-tiktok, replace each REPLACE_… value as this file says, then run npx zap-pack deploy send-offline-conversions-to-facebook-linkedin-tiktok, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
salesforceto the user's Salesforce connection for the org that holds the opportunities. Bindfacebook-conversions,linkedin-conversionsandtiktok-conversionto the user's connections for those ad accounts. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…value replaced by the user's answer.triggers/updated-record.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyisupdated_record, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create and publish the workflow. - Fields: inspect the trigger's fields and the actions' fields with the user's connections before the first test run. The Salesforce
Contactsearch, and the Facebook and TikTok send actions, need their keys checked against the live connection. Fix any key inworkflow.tsthat doesn't match.
Test it
Run this sample as a draft test (run_workflow_draft in Zapier MCP) only after the user agrees to a test run in their accounts. Use a test opportunity the user created for this, not a real deal:
{
"Id": "006exampleopportunity",
"StageName": "Closed Won",
"AccountId": "001exampleaccount"
}
Confirm that each ad platform shows one test conversion with the test contact's email. If run-status tools aren't available, check each platform's events manager directly. The user deletes any test data, not the agent.
Notes
- Once the Zap is published and its trigger is active, every update to a
Closed Wonopportunity sends conversions to all three platforms. Keep the stage value exact so only real wins count. - The Zap sends the first contact's email on the account. If a deal's buyer is a different contact, the conversion goes to the first contact instead.
- The Zap sends the email in lowercase and doesn't hash it itself. Check each platform's action before the first run to confirm it hashes the email on its side.
- Never commit a real pixel, account, advertiser or event set ID, or a real email address.