See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.
When someone starts or continues a chat from a Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad, or from an m.me / ig.me ref link, the Messaging API records where they came from.
When someone who already has a Messenger or Instagram chat taps an ad, Meta doesn’t send a message. OnlySocial records an inbound message reading Opened the chat from an ad that carries the referral, once per tap, so you still see the visit. It appears in the messages endpoint like any other message.
Ad details are only captured while OnlySocial has click-to-message ad triggers and automations turned on for your workspace, and Meta messaging is connected on the Page or Instagram channel. Messages received before that was in place have no referral details.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"OnlySocial API","description":"APIs, webhooks, the MCP server and the Partner API for OnlySocial.","colors":{"primary":"#3B82F6","light":"#60A5FA","dark":"#1D4ED8"},"logo":{"light":"https://mintcdn.com/onlysocial/LJSprGB5_BPvOyDE/logo/onlysocial.png?fit=max\u0026auto=format\u0026n=LJSprGB5_BPvOyDE\u0026q=85\u0026s=f11759a50722ae8548a860bed9c1d8ee","dark":"https://mintcdn.com/onlysocial/LJSprGB5_BPvOyDE/logo/onlysocial.png?fit=max\u0026auto=format\u0026n=LJSprGB5_BPvOyDE\u0026q=85\u0026s=f11759a50722ae8548a860bed9c1d8ee","href":"https://onlysocial.io"},"favicon":"https://mintcdn.com/onlysocial/LJSprGB5_BPvOyDE/favicon.png?fit=max\u0026auto=format\u0026n=LJSprGB5_BPvOyDE\u0026q=85\u0026s=0792889c34deb2cb2fd16f1a9d80f2bb","api":{"playground":{"display":"interactive"}},"navbar":{"links":[{"href":"https://help.onlysocial.io","label":"Help centre"}],"primary":{"type":"button","label":"Open OnlySocial","href":"https://app.onlysocial.io"}},"footer":{"socials":{"website":"https://onlysocial.io"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"onlysocial","hasAudioNarration":false,"actualSubdomain":"onlysocial","customDomains":[],"gitSource":{"type":"github","owner":"ytm2014","repo":"onlysocial-doc","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":"","_id":"6ae53ba728ef3858e045345f"},"chroma":{"latestBuiltDeploymentHistoryId":"6ae54c4795df02a8afc3cedf","collectionId":"92312e7a-dd33-41ff-b4b4-a88eea0aed63","liveDeploymentHistoryId":"6ae54c4795df02a8afc3cedf","schemaVersion":"v3"},"entitlements":{},"buildId":"6ae54c4795df02a8afc3cedf","clientVersion":"0.0.4043","searchFilterCounts":[{"language":"default","tag":"Messaging API","count":50},{"language":"default","tag":"Link in Bio API","count":42},{"language":"default","tag":"Reference","count":41},{"language":"default","tag":"Publishing API","count":29},{"language":"default","tag":"Partner API","count":19},{"language":"default","tag":"Media","count":15},{"language":"default","tag":"Endpoints","count":14},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Contacts","count":10},{"language":"default","tag":"Conversations \u0026 Messages","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"ad-referrals","slug":"/ad-referrals","pageMetadata":{"title":"Ad referrals","description":"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.","href":"/ad-referrals"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`When someone starts or continues a chat from a Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad, or from an `,_jsx(_components.code,{children:`m.me`}),` / `,_jsx(_components.code,{children:`ig.me`}),` ref link, the Messaging API records where they came from.`]}),`\n`,_jsx(Heading,{level:`2`,id:`where-you’ll-find-it`,children:`Where you’ll find it`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Endpoint`}),_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET /api/v1/conversations/{contact}/messages`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`referral`}),` on each message`]}),_jsxs(_components.td,{children:[`The ad or link that message came from, or `,_jsx(_components.code,{children:`null`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`GET /api/v1/conversations`}),` and `,_jsx(_components.code,{children:`GET /api/v1/conversations/{contact}`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`referral`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.strong,{children:`most recent`}),` ad or ref link the person arrived from, or `,_jsx(_components.code,{children:`null`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Same`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`source`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.strong,{children:`first`}),` touch, as text. For example `,_jsx(_components.code,{children:`Messenger ad: 2021 Toyota Corolla LE`}),`, `,_jsx(_components.code,{children:`Instagram ad: Autumn sale`}),`, `,_jsx(_components.code,{children:`WhatsApp ad: ...`}),` or `,_jsx(_components.code,{children:`WhatsApp post: ...`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsxs(_components.a,{href:`/webhooks/events#ad-referrals-on-message-received`,children:[_jsx(_components.code,{children:`salesbot.message.received`}),` webhook`]})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`message.referral`}),` and `,_jsx(_components.code,{children:`contact.source`})]}),_jsxs(_components.td,{children:[`The same 12-key object and first-touch text. `,_jsx(_components.code,{children:`referral`}),` is `,_jsx(_components.code,{children:`null`}),` on an ordinary message.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`the-referral-object`,children:`The referral object`}),`\n`,_jsxs(_components.p,{children:[`The same 12 keys appear on every channel. Each key is always present and is `,_jsx(_components.code,{children:`null`}),` when Meta didn’t send it.`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`source`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ad`}),`, `,_jsx(_components.code,{children:`post`}),` (a WhatsApp ad pointing at an organic post) or `,_jsx(_components.code,{children:`link`}),` (an `,_jsx(_components.code,{children:`m.me`}),` / `,_jsx(_components.code,{children:`ig.me`}),` ref link)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ad_id`})}),_jsx(_components.td,{children:`The ad’s ID`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ad_title`})}),_jsx(_components.td,{children:`The ad’s headline`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`body`})}),_jsx(_components.td,{children:`The ad’s text`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`photo_url`})}),_jsx(_components.td,{children:`Ad image`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`video_url`})}),_jsx(_components.td,{children:`Ad video`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`thumbnail_url`})}),_jsx(_components.td,{children:`Video thumbnail`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`source_url`})}),_jsx(_components.td,{children:`Link to the ad or post`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`post_id`})}),_jsx(_components.td,{children:`The post the ad points at`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`product_id`})}),_jsx(_components.td,{children:`For catalog ads, the catalog product the person tapped (for example a specific vehicle)`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ref`})}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`ref`}),` parameter of the ad or link`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ctwa_clid`})}),_jsx(_components.td,{children:`Click ID (WhatsApp only)`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`20`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"9f1c...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"direction\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"inbound\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"body\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Is this still available?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"referral\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"source\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ad\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ad_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"120210000000000000\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ad_title\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2021 Toyota Corolla LE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"body\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Low mileage, one owner. Message us to book a test drive.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"photo_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://scontent.xx.fbcdn.net/...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"video_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"thumbnail_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"source_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://fb.me/...\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"post_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"product_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"8765432109876543\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ref\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ctwa_clid\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Media URLs are Meta CDN links and expire. Download anything you need to keep. Only plain `,_jsx(_components.code,{children:`http(s)`}),` links are passed through.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`ad-taps-with-no-message`,children:`Ad taps with no message`}),`\n`,_jsxs(_components.p,{children:[`When someone who already has a Messenger or Instagram chat taps an ad, Meta doesn’t send a message. OnlySocial records an inbound message reading `,_jsx(_components.code,{children:`Opened the chat from an ad`}),` that carries the referral, once per tap, so you still see the visit. It appears in the messages endpoint like any other message.`]}),`\n`,_jsx(Heading,{level:`2`,id:`requirements`,children:`Requirements`}),`\n`,_jsx(_components.p,{children:`Ad details are only captured while OnlySocial has click-to-message ad triggers and automations turned on for your workspace, and Meta messaging is connected on the Page or Instagram channel. Messages received before that was in place have no referral details.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Ad referrals","description":"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.","href":"/ad-referrals"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Where you’ll find it","slug":"where-you’ll-find-it","depth":2,"children":[]},{"title":"The referral object","slug":"the-referral-object","depth":2,"children":[]},{"title":"Ad taps with no message","slug":"ad-taps-with-no-message","depth":2,"children":[]},{"title":"Requirements","slug":"requirements","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"onlysocial","siteName":"OnlySocial API","title":"Ad referrals - OnlySocial API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-31T01:50:42.743Z","originalFileLocation":"ad-referrals.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.\">\u003cmeta data-mint-head name=\"application-name\" content=\"OnlySocial API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Ad referrals - OnlySocial API\">\u003cmeta data-mint-head property=\"og:description\" content=\"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"OnlySocial API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://onlysocial.mintlify.app/ad-referrals\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://onlysocial.mintlify.app/_mintlify/api/og/v2?division=Messaging\u0026amp;title=Ad+referrals\u0026amp;description=See+which+Click-to-WhatsApp%2C+Click-to-Messenger+or+Click-to-Instagram+ad+brought+a+contact+in.\u0026amp;theme=413d59e57a1f6eb782bd67f2\u0026amp;signature=cd9cf473152b24cb5bdbad350e4c75c00c0916499a1ee1a7767231fedda0c8be\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Ad referrals - OnlySocial API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://onlysocial.mintlify.app/_mintlify/api/og/v2?division=Messaging\u0026amp;title=Ad+referrals\u0026amp;description=See+which+Click-to-WhatsApp%2C+Click-to-Messenger+or+Click-to-Instagram+ad+brought+a+contact+in.\u0026amp;theme=413d59e57a1f6eb782bd67f2\u0026amp;signature=cd9cf473152b24cb5bdbad350e4c75c00c0916499a1ee1a7767231fedda0c8be\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/onlysocial/e8F8GK-eppzL_Bf4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"OnlySocial API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#3B82F6\">\u003clink data-mint-head rel=\"canonical\" href=\"https://onlysocial.mintlify.app/ad-referrals\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ad-referrals.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://onlysocial.mintlify.app/#organization\",\"name\":\"OnlySocial API\",\"url\":\"https://onlysocial.mintlify.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/onlysocial/LJSprGB5_BPvOyDE/logo/onlysocial.png?fit=max\u0026auto=format\u0026n=LJSprGB5_BPvOyDE\u0026q=85\u0026s=f11759a50722ae8548a860bed9c1d8ee\"}},{\"@type\":\"WebSite\",\"@id\":\"https://onlysocial.mintlify.app#website\",\"name\":\"OnlySocial API\",\"url\":\"https://onlysocial.mintlify.app\",\"publisher\":{\"@id\":\"https://onlysocial.mintlify.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://onlysocial.mintlify.app/ad-referrals#webpage\",\"url\":\"https://onlysocial.mintlify.app/ad-referrals\",\"name\":\"Ad referrals\",\"description\":\"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.\",\"dateModified\":\"2026-10-31T01:50:42.743Z\",\"isPartOf\":{\"@id\":\"https://onlysocial.mintlify.app#website\"},\"breadcrumb\":{\"@id\":\"https://onlysocial.mintlify.app/ad-referrals#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://onlysocial.mintlify.app/ad-referrals#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"OnlySocial API\",\"item\":\"https://onlysocial.mintlify.app\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ad referrals\",\"item\":\"https://onlysocial.mintlify.app/ad-referrals\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://onlysocial.mintlify.app/ad-referrals#article\",\"headline\":\"Ad referrals\",\"name\":\"Ad referrals\",\"description\":\"See which Click-to-WhatsApp, Click-to-Messenger or Click-to-Instagram ad brought a contact in.\",\"url\":\"https://onlysocial.mintlify.app/ad-referrals\",\"mainEntityOfPage\":{\"@id\":\"https://onlysocial.mintlify.app/ad-referrals#webpage\"},\"dateModified\":\"2026-10-31T01:50:42.743Z\",\"publisher\":{\"@id\":\"https://onlysocial.mintlify.app/#organization\"},\"isPartOf\":{\"@id\":\"https://onlysocial.mintlify.app#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"OnlySocial API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"OnlySocial API","nav":{"global":null,"tabs":[{"tab":"Guides","groups":[{"group":"Getting started","pages":[{"title":"Introduction","href":""},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"},{"title":"Errors and limits","href":"/errors-and-limits"}]},{"group":"Webhooks","pages":[{"title":"Webhooks overview","href":"/webhooks/overview"},{"title":"Verify signatures","href":"/webhooks/verify-signatures"},{"title":"Events","href":"/webhooks/events"},{"title":"Managing endpoints","description":"Create, update, test and inspect webhook endpoints through the API.","href":"/webhooks/manage"}]},{"group":"Messaging","pages":[{"title":"Ad referrals","href":"/ad-referrals"}]},{"group":"Integrations","pages":[{"title":"Zapier","description":"Trigger Zaps from messaging events without writing code.","href":"/zapier"}]}]},{"tab":"Messaging API","pages":[{"title":"Messaging API","href":"/messaging/account/get-the-authenticated-workspace"}]},{"tab":"Publishing API","pages":[{"title":"Publishing API","href":"/publishing/diagnostics/check-your-key"}]},{"tab":"Link in Bio API","pages":[{"title":"Link in Bio API","href":"/biolinks/overview"}]},{"tab":"MCP","pages":[{"title":"MCP","href":"/mcp/overview"}]},{"tab":"Partner API","pages":[{"title":"Partner API","href":"/partner/overview"}]}]},"basePath":"","title":"Ad referrals - OnlySocial API","buildId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","deploymentId":"dpl_G9nrg4qeJSZtah1Ziwbc2n6WkLch","dynamics":[],"chunks":[]}