> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Send PostHog conversion events to Snapchat Ads Canonical URL: https://posthog.com/docs/data-pipelines/destinations/snapchat-ads > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.i.posthog.com` instead of `https://us.i.posthog.com` (ingestion host), and use `https://eu.posthog.com` instead of `https://us.posthog.com` or `https://app.posthog.com` (app host for links). ## On this page - [Installation](#installation) - [Configuration](#configuration) - [FAQ](#faq) You'll also need access to the relevant Snapchat Business account. ## Installation 1. In PostHog, click the [Data pipeline](https://app.posthog.com/data-management/destinations) tab in the left sidebar. 2. Click the [Destinations](https://app.posthog.com/data-management/destinations?search=snapchat) tab. 3. Search for **Snapchat Ads Conversions** and click **\+ Create**. 4. Connect your Snapchat Business account at the configuration step. 5. Visit the [Snapchat Business Manager](https://business.snapchat.com/). 1. If you’ve already set up a Pixel for your website, we recommend that you use the same Pixel ID for your browser and server events. 1. To create a new Pixel, click **Pixels** and then click **Create Pixel** button. 2. Choose a name for your Pixel, and then click **Create**. 2. Go to your Pixel by clicking **Pixels** and then click the Pixel you want to use. 3. Copy the Pixel ID. 6. Back in PostHog, add the Pixel ID to the destination configuration. 7. Set up your event and property filters to remove unnecessary events. You only want to send events that are conversions. Filter out unrelated events or ones missing required data. 8. Press **Create & enable**, test your destination, and then watch your conversions get sent to Snapchat Ads. ## Configuration | Option | Description | | --- | --- | | `Snapchat account` **Type:** integration **Required:** True | | | `Pixel ID` **Type:** string **Required:** True | You must obtain a Pixel ID to use the Conversions API. If you've already set up a Pixel for your website, we recommend that you use the same Pixel ID for your browser and server events. | | `User data` **Type:** dictionary **Required:** True | A map that contains customer information data. See this page for options: [https://developers.snap.com/api/marketing-api/Conversions-API/Parameters#user-data-parameters](https://developers.snap.com/api/marketing-api/Conversions-API/Parameters#user-data-parameters) | | `Test Event Mode` **Type:** boolean **Required:** False | Use this field to specify that events should be test events rather than actual traffic. You'll want to disable this field when sending real traffic through this integration. | How to create this via the API Using our REST API you can create this destination like so: ```bash # Create a new destination curl --location 'https://us.i.posthog.com/api/environments/:project_id/hog_functions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer ' \ --data '{ "type": "destination", "name": "Snapchat Ads Conversions", "inputs": { "oauth": { "value": "" }, "pixelId": { "value": "" }, "userData": { "value": { "ct": "{not empty(person.properties.$geoip_city_name) ? sha256Hex(replaceAll(lower(person.properties.$geoip_city_name), ' ', '')) : null}", "em": "{sha256Hex(lower(person.properties.email))}", "fn": "{sha256Hex(lower(person.properties.first_name))}", "ln": "{sha256Hex(lower(person.properties.last_name))}", "ph": "{not empty(person.properties.phone) ? sha256Hex(replaceAll(person.properties.phone, '+', '')) : null}", "st": "{sha256Hex(lower(person.properties.$geoip_subdivision_1_code))}", "zp": "{not empty (person.properties.$geoip_postal_code) ? sha256Hex(replaceAll(lower(person.properties.$geoip_postal_code), ' ', '')) : null}", "country": "{sha256Hex(lower(person.properties.$geoip_country_code))}", "external_id": "{sha256Hex(person.id)}", "sc_click_id": "{person.properties.sccid ?? person.properties.$initial_sccid}", "client_ip_address": "{event.properties.$ip}", "client_user_agent": "{event.properties.$raw_user_agent}" } } }, "enabled": true, "template_id": "template-snapchat-ads" }' ``` ## FAQ ### Why is person data missing from my ad destination events? Ad destinations filter the realtime event stream. This means they use person data as it exists at the exact moment the event is processed, not data added later. A common issue occurs when a backend event triggers the destination, but person properties are set by a frontend `identify` call that happens afterward. If the identify call merges with the person *after* the trigger event is processed, the destination won't have access to that data. To fix this, either: 1. **Include the data directly in the event** that triggers the destination (e.g., pass email, phone, or other required properties as event properties) 2. **Ensure the identify call happens before** the events you want to send to the ad platform ### Is the source code for this destination available? PostHog is open-source and so are all the destination on the platform. The [source code](https://github.com/PostHog/posthog/blob/master/nodejs/src/cdp/templates/_destinations/snapchat_ads/snapchat.template.ts) is available on GitHub. ### Who maintains this? This is maintained by PostHog. If you have issues with it not functioning as intended, please [let us know](https://us.posthog.com/#panel=support%3Asupport%3Aapps%3A%3Atrue)! ### What if I have feedback on this destination? We love feature requests and feedback. Please [tell us what you think](https://us.posthog.com/#panel=support%3Afeedback%3Aapps%3Alow%3Atrue). ### What if my question isn't answered above? We love answering questions. Ask us anything via [our community forum](https://posthog.com/questions.md).