4based/API
← 4based ads tracking
4based

4based Snapchat Pixel and Conversions API tracking

4based Snapchat CAPI sends every 4based subscription, PPV purchase and tip to Snapchat server-side, with the original ScCid click ID and deduplication built in.

Request accessLast updated:

4based Snapchat CAPI is the server-side bridge between your 4based tracking links and your Snapchat ad account. This guide explains how the integration works, what you need before you start, how to set it up step by step, and how to verify that every conversion is counted exactly once.

Browser-only tracking misses a large share of conversions on creator platforms: fans click an ad on mobile, land on a tracking link, and subscribe later inside an in-app browser or on another device. Cookie restrictions, ad blockers and iOS privacy features break the chain. Server-side events from 4based API close that gap by sending the conversion directly from our infrastructure to Snapchat, tied back to the original click.

4based API is an independent developer platform. The 4based events described here are part of the 4based API product's normalized event model and are delivered through your own Snapchat credentials.

What you get

  • Server-side Snapchat conversions for subscriptions, renewals, PPV purchases and tips
  • Automatic ScCid capture on every 4based tracking link
  • Deduplication against the browser pixel with one shared event_id
  • Per-creator ROAS, CPA and LTV reporting in the 4based API dashboard

How does 4based Snapchat Pixel and Conversions API tracking work?

  1. 1

    Ad click

    A fan taps your Snapchat ad and Snapchat appends ScCid to the URL.

  2. 2

    Tracking link

    Your 4based tracking link saves ScCid as a first-party value for 90 days.

  3. 3

    4based conversion

    The fan subscribes, renews, buys a PPV message or sends a tip on 4based.

  4. 4

    4based API

    We hash identifiers, assign one event_id, apply consent and sign the event.

  5. 5

    Snapchat

    The event is posted to Snapchat and appears in reporting within minutes.

Before you start

  • An active Snapchat ad account with admin or advertiser access
  • Your Snap Pixel ID
  • A Conversions API token
  • At least one 4based tracking link for the creator you are promoting
  • A 4based API key from your dashboard (request access if you do not have one yet)

Step-by-step setup

  1. 1. Create the pixel or dataset

    Open Snapchat Events Manager, create a new Snap Pixel for the creator's funnel and copy its ID. One Snap Pixel per creator keeps reporting clean, but agencies can also share one across a roster.

    Snap Pixel ID: 1234567890

    Status: Active

    Source: Website

  2. 2. Generate the access token

    In the Snap Pixel settings generate a Conversions API token. Store it like a password: anyone who has it can send events to your account.

    Token: EAAG....(hidden)

    Created: today

    Permissions: send events

  3. 3. Connect in the 4based API dashboard

    Open Ads Tracking in the dashboard, choose Snapchat, paste the Snap Pixel ID and token, and pick which creators the connection applies to. 4based API validates the credentials immediately.

    Snapchat: Connected

    Creators: 3 selected

    Validation: OK

  4. 4. Add the tracking link to your ads

    Use your 4based tracking link as the destination URL in every Snapchat ad. Do not strip query parameters: ScCid must reach the landing page. Add the click capture snippet below if you host your own landing page.

    Destination: link.example.com/summer

    Auto-tag: ScCid on

    UTM: preserved

  5. 5. Map 4based events

    Review the default mapping from 4based events to Snapchat events and turn on the events you want to optimize for. Values and currency are filled in automatically from the transaction.

    Subscribe: on

    Purchase (PPV, tip, renewal): on

    Lead: on

  6. 6. Send a test event

    Use Events Manager (test mode) to get a test code, paste it into the dashboard and send a test event. A good result appears within a minute and shows the expected identifiers.

    Test event: Purchase

    Status: Received

    Matched identifiers: 4

Capture the click ID

Fans may convert hours or days after the click, so ScCid must survive the session. If you use a 4based API hosted tracking link this happens automatically. If you run your own landing page, add this snippet. It reads ScCid from the URL and stores it in a first-party cookie for 90 days.

capture-click-id.ts
// capture-click-id.ts - runs on your tracking-link landing page
const PARAMS = ["ScCid"];
const NINETY_DAYS = 60 * 60 * 24 * 90;
const url = new URL(window.location.href);
for (const name of PARAMS) {
  const value = url.searchParams.get(name);
  if (!value) continue;
  document.cookie = `4b_${name}=${encodeURIComponent(value)}; Max-Age=${NINETY_DAYS}; Path=/; SameSite=Lax; Secure`;
}
// The 4based API tracking link reads this cookie and stores the click ID with the fan.

Event mapping

The table shows how each 4based event maps to Snapchat, with required and recommended parameters. Required parameters are always sent; recommended parameters are sent when the data is available and consent allows it.

4based eventSnapchatRequiredRecommended
Tracking link clickPAGE_VIEWevent_name, event_time, action_source: WEBsc_click_id, client_user_agent
Free follow / signupSIGN_UPevent_name, event_id, user_data.emclient_ip_address, sc_cookie1
New subscriptionSUBSCRIBEevent_id, value, currencysc_click_id
RenewalPURCHASEevent_id, value, currencycontent_category: subscription
PPV message purchasePURCHASEevent_id, value, currencycontent_category: ppv
TipPURCHASEevent_id, value, currencycontent_category: tip

Full payload example

You call one 4based API endpoint (POST https://api.4basedapi.com/v1/ads/snapchat/events). 4based API translates it into the Snapchat request (POST https://tr.snapchat.com/v3/{PIXEL_ID}/events). The examples below send a purchase event in cURL, TypeScript and Python.

curl -X POST https://api.4basedapi.com/v1/ads/snapchat/events \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "pixel_id": "a1b2c3d4-0000-0000-0000-000000000000",
    "test_mode": true,
    "event": {
      "event_name": "PURCHASE",
      "action_source": "WEB",
      "event_time": 1717000000,
      "event_id": "4based_ppv_msg5531",
      "event_source_url": "https://link.example.com/summer",
      "user_data": {
        "em": ["<sha256(email)>"],
        "client_ip_address": "203.0.113.7",
        "client_user_agent": "Mozilla/5.0 ...",
        "sc_click_id": "<ScCid>",
        "sc_cookie1": "<_scid cookie>"
      },
      "custom_data": { "currency": "USD", "value": 14.99 }
    }
  }'

How does ScCid reach Snapchat?

Snapchat appends ScCid to the landing URL when a fan swipes up on your ad. The landing script saves it in a first-party cookie and the Snap Pixel, when installed, sets _scid. 4based API stores both with the fan and sends them as sc_click_id and sc_cookie1 on every later event.

Under the hood 4based API calls POST https://tr.snapchat.com/v3/{PIXEL_ID}/events with action_source: "WEB" and your Conversions API token. Snapchat uses upper-case event names such as PURCHASE, SUBSCRIBE, SIGN_UP and PAGE_VIEW, and 4based API maps 4based events to these names automatically.

Why does Snapchat need IP and user agent?

Snapchat matches server events to Snapchatters with a combination of click ID, hashed email, client_ip_address and client_user_agent. Fans often convert on 4based in a different session from the ad click, so passing the original click context with each event noticeably increases matched conversions in Ads Manager.

Deduplication

If you run the Snapchat browser pixel alongside server events, both will report the same conversion. To avoid double counting, both must carry the same identifier: event_id.

4based API generates the event_id from the 4based transaction, for example 4based_sub_abc123 for a subscription or 4based_ppv_msg5531 for a PPV purchase. If you fire the browser event yourself, read the same value from the tracking-link data layer and pass it to the browser call.

Snapchat keeps the first event it receives and discards later duplicates within its deduplication window. Server events usually arrive first, so the browser event mainly adds extra signal.

Matching and privacy

Emails are trimmed, lowercased and hashed with SHA-256 before they leave 4based API. Phone numbers are normalized to E.164 and hashed the same way. Raw personal data is never sent to any ad platform.

Fields sent to Snapchat: hashed email when available, ScCid, _scid when present, client IP address and user agent from the click, event_id, value and currency. Nothing else is sent.

Consent is respected end to end. 4based API reads IAB TCF v2.2 strings and Google Consent Mode v2 signals recorded on the tracking link. Without advertising consent, hashed identifiers are withheld, and in consent regions the event is blocked entirely. Hashing is not anonymization, so treat hashed identifiers as personal data.

Test and verify

Open Events Manager (test mode). Copy the test code and paste it into the Snapchat connection in the 4based API dashboard, then click Send test event.

A good result shows the event within a minute with the correct event name, value and currency, plus at least the click ID and one more identifier. Remove the test code once you are done, otherwise live events may be routed to the test view.

After going live, compare conversions in Snapchat with the 4based API dashboard for the same day. Differences under 5 percent are normal because of attribution windows and time zones.

Troubleshooting

SymptomCauseFix
No events in test viewTest code missing or expiredGenerate a new test code and paste it again
Events arrive without ScCidQuery parameters stripped by a redirectUse the tracking link directly as the ad destination
Conversions counted twiceBrowser and server events use different IDsPass the same event_id to the browser call
Invalid token errorToken revoked or for another accountGenerate a new token and reconnect
Low match qualityMissing IP, user agent or emailEnable click context capture and hashed email with consent
Wrong currency or valueCreator currency not setSet the default currency per creator in the dashboard
Events blockedNo advertising consent recordedCheck the consent banner on your landing page

Frequently asked questions

Create a Snap Pixel in Snapchat Ads Manager, generate a Conversions API token and add both to the 4based API dashboard. Events use the ScCid click ID captured on your tracking link.

Build with 4based API

Ready to build?

Tell us what you want to automate, measure or build on top of 4based. Agencies, developers and automation teams all get a tailored next step from our team.