# Send PostHog conversion events to Snapchat Ads - Docs

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 accountType: integrationRequired: True |
| Pixel IDType: stringRequired: 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 dataType: dictionaryRequired: 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 ModeType: booleanRequired: 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:

Terminal

PostHog AI

```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 <POSTHOG_PERSONAL_API_KEY>' \
--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

### 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](/questions.md).

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better