Skip to content
Last updated

Snapchat Conversions API Export Integration

This feature is in BETA version. For more information, contact your Customer Success Representative.

Overview

The Snapchat Conversions API (CAPI) connector enables server-side tracking and measuring conversion events across web, mobile, and offline channels. By integrating directly with Snapchat's Events Manager, this connector helps businesses measure campaign performance and optimize ad delivery more effectively across Snapchat's 300M+ daily active users.

Key capabilities:

  • Web Events: Server-side tracking to complement pixel data for enhanced measurement accuracy
  • Mobile App Events: Direct integration of in-app conversion events
  • Offline Events: Support for non-digital conversions like in-store purchases
  • Data Validation: Automated event validation and formatting to Snapchat's CAPI specifications

This server-side integration provides more reliable conversion tracking and improved advertising performance measurement compared to client-side solutions alone.

Prerequisites

  • Basic knowledge of Treasure Data, including the TD Toolbelt.
  • Basic knowledge of Snapchat Business.
  • Snapchat Access Token or Snapchat Business account

Limitations & Known Issues

  • Event Time Restrictions

    • Events older than 7 days (based on event_time) will be skipped during processing
    • Event time validations use UTC timezone for epoch conversions and 7-day window calculations
  • Invalid Event Source ID Error Message Discrepancies between oAuth Authentication and Conversion API token authentication

    • Different authentication methods produce varying error responses for invalid event_source_id:
      • When using Conversion API Token Authentication, the error message will be:
        {  "status": "INVALID",  "reason": "Unauthorized resources" }
  • When using OAuth Authentication, the error message will be:

    {  "status": "INVALID",  "test_event": true,  "reason": "At least one of the events is invalid.",  "event_logs": [    {   "event": 1,     "status": "INVALID",     "errors": {       "codes": [         "523"       ],       "error_msgs": [         "The provided asset id must be valid UUID format."       ]            }  }}
  • When using OAuth authentication, the error response message does not explicitly indicate an invalid Event Source ID, instead referring to an invalid “asset id.” Therefore, for more reliable error handling when you’re unsure about the Event Source ID, it's recommended to use Conversion API Token authentication when running the job.

  • Anonymous ID Field (anon_id): Despite being documented as a standard field in the “User Data Parameter” section of the API documentation (Link), anon_id cannot be included in the user_data object

    • Attempting to use anon_id in user_data results in the following error:

      {  "status": "INVALID",  "reason": "Request parsing failed. Ensure the request body is correctly formatted." }
    • So, as a workaround, we have to map anon_id to the custom data object instead of the user_data object to avoid the API error.

Create a New Connection via TD Console

Before running your query, you must create and configure the data connection on the TD Console. As part of the data connection, you provide authentication to access the integration. Complete the following steps.

  1. Open TD Console.

  2. Navigate to Integrations Hub > Catalog.

  3. Search for and select Snapchat Conversions API. Hover over the icon and selectCreate Authentication.

  4. Ensure that the Credentials tab is selected, and then enter credential information for the integration. Choose one of the following

    1. **OAuth Authentication Workflow:**Select the link "Click here" to start the OAuth authentication flow. After completing the authentication, a new OAuth connection will be created and available in the dropdown.

      Select Continue to create a new connection.

      b. Conversion API Token Workflow: Obtain the access token from the Snapchat Business Manager and input it in the Conversion API Token field.

      Authentication Fields

      ParameterDescription
      Authentication ModeAuthentication method. Supported values: - oAuth Connection: OAuth Authentication - Conversions API Token: Long live access token generated in the Snapchat Business Manager.
      Conversions API TokenYou can obtain the Conversions API Token from the Snapchat Business Manager. This parameter is only available for Conversion API Token authentication methods.
  5. Select Continue.

  6. Enter a name for your authentication, and select Done.

Configure a Query Result for Export

The TD Console supports multiple ways to export data. Please follow these steps to export data from the Data Workbench.

  1. Navigate to Data Workbench > Queries.
  2. Select New Query, and define your query.
  3. Select Export Results to configure the data exporting.
  4. Select an existing Snapchat CAPI authentication or create a new one described previously
  5. Select Done.

Connector Configuration Parameters

FieldDescription
Event Source TypeSelect the type of Snapchat event data source you are using. Supported event source types include: - Web Events - Mobile App Events - Offline Events
Event Source IDSelect the specific event source to upload event data to by inputting either pixel_id for Web Events/Offline Events and snap_app_id for Mobile App Events.
Send test eventsEnable this to send test events instead of real traffic.
Skip invalid records?If checked, the job will skip the invalid record and continue to handle the next record. Otherwise, the job will stop.

Detailed Guide for Query Result Data Specs

To upload event data to Snapchat CAPI, you need to build a data export query that includes a combination of standard fields and custom fields that adhere to Snapchat CAPI guidelines. For standard fields, ensure the column names match those listed in the "Field/Column-Level Specifications" section. The connector automatically normalizes the column names to match Snapchat CAPI's required format, so you do not need to worry about case sensitivity. For example, for the default field "event_name," the column name in your export query can be written in any case, such as "EVENT_NAME," "event_name," or "Event_Id." The connector will standardize the column name to "event_name" to meet Snapchat CAPI's requirements.

To successfully upload/modify user profile data to Snapchat CAPI, you must construct an export query that adheres to specific data specifications. These specifications are divided into two levels:

  • Export Query Specifications (or Dataset-level data specs): This section describes the requirements and rules that apply to your entire query result dataset, such as the presence of required fields and data validation rules that span multiple fields.
  • Field/Column-Level Specifications: This section details the requirements and rules for individual fields/columns in your dataset, such as data types and formats for each field.

Export Query Specifications

SpecificationDescription
Conditionally Required Fields for User DataAt least one of the following identifier fields must be present in your export query:
  • Email (em)
  • Phone (ph)
  • Snapchat click ID (sc_click_id)
  • Client IP address (client_ip_address)/Client user agent (client_user_agent)
  • Mobile advertiser ID (madid)
Conditionally Required Fields for PURCHASE EventsWhen your export query contains PURCHASE events, the following fields are required:
  • currency (must be a valid ISO 4217 code)
  • value (must be a numeric value)
Standard Field NamesColumn names for standard fields can be written in any case (e.g., "EVENT_NAME", "event_name", "Event_Name"). The connector automatically standardizes them to match Snapchat CAPI requirements.
Null Value HandlingColumns with NULL values are ignored during export.
Duplicated ColumnsDuplicate column names within the export query are not allowed.
Custom FieldsAny fields not listed in the standard fields will be automatically mapped to the custom_data object and preserved as-is. No normalization/formatting will be done.
Date-Time FormattingFor the event_time field, the following formats are accepted:
  • Integer (Unix epoch timestamp) with 10 or more digits
  • ISO 8601 formatted string
  • Timestamp data type

Array Field Formatting

For fields that accept arrays (e.g., content_ids, content_category, suggested_destinations): they can be constructed using either:

  1. Single column containing array values or
  2. Flattened column names with numeric suffixes

Flattened Column Pattern: field_name_[index] where the index starts from 1

Example: To create an array field cont_id with three values, you can use these columns:

  • cont_id_1
  • cont_id_2
  • cont_id_3

These will be automatically combined into: ["value1", "value2", "value3"]

JSON Object Array Construction

The contents field for the PURCHASE event must be formatted as a list of JSON objects, each containing optional fields:

  • id (string)
  • quantity (integer)
  • item_price (float)
  • delivery_category (string)

Arrays of objects can be constructed using flattened column names in the pattern: field_name_property_name_[index]

Example: To create the contents array of objects in data[].custom_data.contents, you can use:

First object:

  • content_id_1
  • content_quantity_1
  • content_item_price_1
  • content_delivery_category_1

Second object:

  • content_id_2
  • content_quantity_2
  • content_item_price_2
  • content_delivery_category_2

This will be automatically constructed as:

[
  {
    "id": "ABC123",
    "quantity": 2,
    "item_price": 29.99,
    "delivery_category": "standard"
  },
  {
    "id": "XYZ789",
    "quantity": 1,
    "item_price": 49.99,
    "delivery_category": "express"
  }
]
Date Field FormatsThe checkin_date date field for the Custom Data object accepts the following formats:
  • YYYYMMDD
  • YYYY-MM-DD
Required Fields for App EventsWhen sending app events, the following fields are required in your export query:
  • advertiser_tracking_enabled (Boolean)
  • extinfo (array of exactly 16 elements)
  • app_id (string)
extinfo Array RequirementsThe extinfo field must:
  • Contain exactly 16 elements
  • Start with "i2" (iOS) or "a2" (Android) as the first element

Hashed Field Handling

For fields requiring SHA256 hashing in the user_data object, the connector will handle different scenarios as follows:

  1. Already Hashed Data:
    • If data is already hashed with SHA256 (verified by HEX pattern), it will be used as-is
    • If data is hashed but not with SHA256, it will be treated as raw data and re-hashed
  2. Raw Data:
    • Email (em): Will be validated for email format, then normalized and hashed
    • Other fields (ph, fn, ln, etc.): Will be normalized and hashed without format validation

Note: The connector handles all normalization/hashing automatically - you can provide either raw or SHA256 hashed data

Field/Column-Level Specifications

There is Special Field Handling

Country Field

  • For user_data object: Use column name “country” (case-insensitive)
  • For custom_data object: Use column name “custom_country” (case-insensitive)

Punctuation Marks Removal

Specific fields require the removal of punctuation marks. When this applies, the following characters will be removed:

  • Basic punctuation: . , ! ? ; : - — " ' ( ) [ ] { } / _
  • Special characters: & * + = @ # $ % ^ ~ |

Handling Date-Time

The integration can handle values cast as timestamps or in ISO-8601 date-time string format for date-time custom field columns. When using ISO-8601 date-time strings, ensure the value includes the letter “Z” at the end to allow the connector to detect and convert the date-time value into a Unix time value as required by Snapchat CAPI’s API contract.

Examples for Handling Date-Time Custom Field Columns

1. Casting as Timestamp

  • Create a column of type string in the source data table:

    ALTER TABLE source_data_table ADD COLUMN date_time_field VARCHAR;
  • Insert date-time value strings into that column:

    INSERT INTO source_data_table (id, date_time_field)VALUES(1, '2024-08-28'),(2, '2024-08-28 15:30:00'),(3, '2024-08-28T15:30:00');
  • Cast the column value as timestamp:

    SELECT id, CAST(date_time_field AS timestamp) AS date_time_field FROM source_data_table;

2. Using ISO-8601 Date-Time String

  • Create a column of type string in the source data table:

    ALTER TABLE source_data_table ADD COLUMN date_time_field VARCHAR;
  • Insert date-time value strings into that column, ensuring they are formatted as ISO-8601 with a “T” separator and “Z” at the end:

    INSERT INTO source_data_table (id, date_time_field)VALUES(1, '2024-08-28T00:00:00Z'),(2, '2024-05-28T15:30:00.123Z'),(3, '2024-02-28T15:30:00Z');
  • Use the column directly in the query:

    SELECT id, date_time_field FROM source_data_table;

Standard Fields for Server Parameters (Top-level parameters)

FieldDescriptionRequiredData TypeAdditional Specifications
event_nameThe type of event being trackedYesStringMust be one of the following values:
  • PURCHASE
  • SAVE
  • START_CHECKOUT
  • ADD_CART
  • VIEW_CONTENT
  • ADD_BILLING
  • SIGN_UP
  • SEARCH
  • PAGE_VIEW
  • SUBSCRIBE
  • AD_CLICK
  • AD_VIEW
  • COMPLETE_TUTORIAL
  • LEVEL_COMPLETE
  • INVITE
  • LOGIN
  • SHARE
  • RESERVE
  • ACHIEVEMENT_UNLOCKED
  • ADD_TO_WISHLIST
  • SPENT_CREDITS
  • RATE
  • START_TRIAL
  • LIST_VIEW
  • APP_INSTALL
  • APP_OPEN
  • CUSTOM_EVENT_1-5
event_timeTimestamp of the event occurrenceYesInteger/String/Timestamp
  • If integer: Must be Unix epoch timestamp with 10+ digits
  • If string: Must be ISO 8601 format
  • If timestamp: Will be converted to epoch milliseconds
  • Cannot be more than 7 days in the past

event_source_url

URL where the event occurred

Yes (for web events)

String

Must include protocol (http/https)

Example: https://example.com/page

event_idUnique identifier for the eventNoStringChosen by the advertiser to represent a unique event
action_sourceSource of the eventYes*String*Automatically set based on configuration screen selection:
  • WEB
  • OFFLINE
  • MOBILE_APP
data_processing_optionsPrivacy processing optionsNoArray of stringsAccepted values: ["LMU"], ["DELETE"]
advertiser_tracking_enabledTracking permission indicatorNoBoolean
  • 1 for OPT_IN
  • 0 for OPT_OUT
  • For web events: Used in top-level parameters
  • For app events: Used in app data object

Standard Fields for User Data Object

The following fields are used to identify users and their attributes. At least one identifier field is required from: email (em), phone (ph), sc_click_id, client_ip_address, client_user_agent, or mobile advertiser id (madid).

FieldDescriptionRequiredData TypeFormatting RequirementsExample
emEmail addressConditional*String/Array- Spaces are trimmed - Converted to lowercase - Must be valid email format - Will be automatically hashedInput: Person@Example.com Normalized: person@example.com
phPhone numberConditional*String/Array- Spaces removed - Leading ‘00’ and ‘0’ removed - Non-numeric chars, ‘+’, ‘-’ excluded - Must include country code - Will be automatically hashedInput: +44 844 412 4653 Normalized: 448444124653
sc_click_idSnapchat click ID from URLConditional*String- Must be in UUID format - Found in landing page URL’s ScCid parameter123e4567-e89b-12d3-a456-426614174000
client_ip_addressDevice IP addressConditional*String- Supports IPv4 and IPv6 - Must be device IP, not server IP203.0.113.195
client_user_agentDevice user agentConditional*StringNo special formatting requiredChrome/87.0.4180.143
madidMobile advertiser IDConditional*StringAutomatically converted to lowercaseInput: 123ABC Normalized: 123abc

*At least one of these identifier fields is required.

Optional User Attributes
FieldDescriptionData TypeData handling
fnFirst nameString/Array- Converted to lowercase - Punctuation removed - Special characters UTF-8 encoded - Will be automatically hashed
lnLast nameString/Array- Converted to lowercase - Punctuation removed - Special characters UTF-8 encoded - Will be automatically hashed
geGenderString/Array- Converted to lowercase - Accepted values: ‘f’ for female, ‘m’ for male - Will be automatically hashed
ctCityString/Array- Converted to lowercase - Punctuation and spaces removed - Special characters UTF-8 encoded - Will be automatically hashed
stStateString/Array- US: Use 2-character ANSI code - Converted to lowercase - No punctuation, special chars, or spaces - Will be automatically hashed
zpZip/postal codeString/Array- Converted to lowercase - Spaces and ‘-’ removed - US: Use 5 digits - Will be automatically hashed
countryCountryString/Array- Converted to 2-letter ISO 3166-1 alpha-2 code - Converted to lowercase - Will be automatically hashed
Additional Identifier Fields
FieldDescriptionRequiredNotes
external_idUnique identifier (e.g., loyalty card ID)NoWill be automatically hashed
subscription_idSubscription identifierNo
lead_idSnapchat Lead Ad identifierNo
anon_idApp install identifierNoFor app events only, this field will be mapped to custom_data object to avoid Snapchat API error
download_idApp download identifierNo
sc_cookie1First-party cookie from Pixel SDKNoMust be UUID format
idfvIDFV valueNoPlain text value
Important Notes about User Data:
  1. Conditional Requirements: You must include at least one of the conditional identifier fields (em, ph, sc_click_id, client_ip_address, client_user_agent, or madid).
  2. Automatic Processing: The connector automatically handles:
    • Field normalization (lowercase conversion, space removal, etc.)
    • Hashing of sensitive fields
    • UTF-8 encoding where required
  3. Multiple Values: Fields marked as String/Array can accept either a single value or multiple values

Standard Fields for Custom Data Object

FieldDescriptionRequiredData TypeAdditional Specifications
content_categoryItem or category classificationNoString/Array- Can be a single value or array Example: "shoes" or ["coats", "shoes", "umbrellas"]
content_idsProduct/category identifiersNoArray- Can be a single ID or comma-separated list Example: "sku001" or ["sku001", "sku002", "sku003"]
content_namePage/product nameNoStringExample: "Running Shoes"
content_typeType of content identifierNoString- Accepted values: productproduct_group
contentsDetailed item purchase informationNoArray of Objects- Each object may include: • id (string) • quantity (integer) • item_price (float) • delivery_category (string) Example: [{"id": "123", "quantity": 2, "item_price": 29.99, "delivery_category": "standard"}]
currencyTransaction currencyYes for PURCHASEString- Must be standard ISO 4217 code (e.g., USD, AED, AUD)
num_itemsTotal item countNoStringExample: "3"
order_idOrder identifierNoStringExample: "ORD12345"
predicted_ltvPredicted lifetime valueNoFloatExample: 150.75
valueEvent monetary valueYes for PURCHASEFloatExample: 99.99
search_stringSearch query textNoStringExample: "running shoes"
FieldDescriptionRequiredData TypeExample
checkin_dateHotel check-in dateNoStringFormat: YYYY-MM-DD Example: "2024-09-13"
travel_startTravel start dateNoStringExample: "2024-09-13"
travel_endTravel end dateNoStringExample: "2024-09-20"
suggested_destinationsRecommended destinationsNoString/ArrayExample: ["destination1", "destination2"]
destination_airportIATA code of destinationNoStringExample: "JFK"
origin_airportIATA code of originNoStringExample: "LAX"
FieldDescriptionRequiredData TypeExample
countryDestination countryNoStringExample: "US"
cityDestination cityNoStringExample: "New York"
regionState/district/regionNoStringExample: "NY"
neighborhoodSpecific neighborhoodNoStringExample: "Brooklyn"
postal_codePostal/zip codeNoStringExample: "10001"
Travel Schedule Fields
FieldDescriptionRequiredData TypeExample
departing_departure_dateOutbound departureNoStringExample: "2024-09-13T08:00"
departing_arrival_dateOutbound arrivalNoStringExample: "2024-09-13T12:00"
returning_departure_dateReturn departureNoStringExample: "2024-09-20T08:00"
returning_arrival_dateReturn arrivalNoStringExample: "2024-09-20T12:00"
FieldDescriptionRequiredData TypeExample
num_adultsNumber of adultsNoIntegerExample: 2
num_childrenNumber of childrenNoIntegerExample: 1
num_infantsNumber of infantsNoIntegerExample: 0
hotel_scoreHotel rating scoreNoStringExample: "4.5"
preferred_neighborhoodsPreferred areasNoString/ArrayExample: ["neighbor1", "neighbor2"]
preferred_star_ratingsHotel star rating rangeNoString/ArrayExample: ["star1", "star2"]
suggested_hotelsRecommended hotelsNoString/ArrayExample: ["hotel1", "hotel2"]
destination_idsCatalog destination IDsNoString/ArrayExample: ["dest1", "dest2"]

Standard Fields for App Data Object

FieldDescriptionRequiredData TypeAdditional Specifications
advertiser_tracking_enabledUser tracking opt-in statusYesBoolean1 for OPT_IN - 0 for OPT_OUT - For iOS 14.5+: Set to ATT Authorization Status
app_idApplication identifierYesString- iOS: Numeric format (e.g., 447188370) - Android: Package name format (e.g., com.snapchat.android)
extinfoDevice and app informationYesArrayMust contain exactly 16 elements in a specific order (see detailed specs below)
extinfo Array Specifications

The extinfo array must contain exactly 16 elements in the following order,  use the exact column name as specified in the "Column Name" for the connector to build the accurate array:

IndexColumn NameDescriptionData TypeRequirementsExample
0device_osOS identifierStringMust be “i2” (iOS) or “a2” (Android)"i2"
1package_nameApp package nameString"com.snapchat.sdk"
2short_versionApp short versionString/Integer"1.0"
3long_versionApp long versionString"1.0"
4os_versionDevice OS versionString"10.3.1"
5device_modelDevice modelString"iphone14"
6localeDevice localeString"En_US"
7timezone_abbrTimezone abbreviationString"EDT"
8carrierMobile carrierString"AT&T"
9screen_widthScreen widthIntegerMust be Int64320
10screen_heightScreen heightIntegerMust be Int64568
11screen_densityScreen densityString"2"
12cpu_coresNumber of CPU coresIntegerMust be Int642
13storage_sizeTotal storage (GB)IntegerMust be Int6415
14free_storage_sizeAvailable storage (GB)IntegerMust be Int648
15timezone_locationDevice timezoneString"USA/New York"

Example complete extinfo array:

["i2", "com.snapchat.sdk", "1.0", "1.0", "10.3.1", "iphone14", "En_US", "EDT", "AT&T", "320", "568", "2", "2", "15", "8", "USA/New York"]
Important Notes for App Events:
  1. All three fields (advertiser_tracking_enabledapp_id, and extinfo) are required for app events
  2. The extinfo array must maintain the exact order specified above
  3. Integer values in extinfo must be provided as Int64 type
  4. First element of extinfo determines the platform (iOS/Android)

(Optional) Schedule Query Export Jobs

You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.

Treasure Data's scheduler feature supports periodic query execution to achieve high availability.

When two specifications provide conflicting schedule specifications, the specification requesting to execute more often is followed while the other schedule specification is ignored.

For example, if the cron schedule is '0 0 1 * 1', then the 'day of month' specification and 'day of week' are discordant because the former specification requires it to run every first day of each month at midnight (00:00), while the latter specification requires it to run every Monday at midnight (00:00). The latter specification is followed.

Scheduling your Job Using TD Console

  1. Navigate to Data Workbench > Queries

  2. Create a new query or select an existing query.

  3. Next to Schedule, select None.

  4. In the drop-down, select one of the following schedule options:

    Drop-down ValueDescription
    Custom cron...Review Custom cron... details.
    @daily (midnight)Run once a day at midnight (00:00 am) in the specified time zone.
    @hourly (:00)Run every hour at 00 minutes.
    NoneNo schedule.

Custom cron... Details

Cron ValueDescription
0 * * * *Run once an hour.
0 0 * * *Run once a day at midnight.
0 0 1 * *Run once a month at midnight on the morning of the first day of the month.
""Create a job that has no scheduled run time.
 *    *    *    *    *
 -    -    -    -    -
 |    |    |    |    |
 |    |    |    |    +----- day of week (0 - 6) (Sunday=0)
 |    |    |    +---------- month (1 - 12)
 |    |    +--------------- day of month (1 - 31)
 |    +-------------------- hour (0 - 23)
 +------------------------- min (0 - 59)

The following named entries can be used:

  • Day of Week: sun, mon, tue, wed, thu, fri, sat.
  • Month: jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec.

A single space is required between each field. The values for each field can be composed of:

Field ValueExampleExample Description
A single value, within the limits displayed above for each field.
A wildcard '*' to indicate no restriction based on the field.'0 0 1 * *'Configures the schedule to run at midnight (00:00) on the first day of each month.
A range '2-5', indicating the range of accepted values for the field.'0 0 1-10 * *'Configures the schedule to run at midnight (00:00) on the first 10 days of each month.
A list of comma-separated values '2,3,4,5', indicating the list of accepted values for the field.0 0 1,11,21 * *'Configures the schedule to run at midnight (00:00) every 1st, 11th, and 21st day of each month.
A periodicity indicator '*/5' to express how often based on the field's valid range of values a schedule is allowed to run.'30 */2 1 * *'Configures the schedule to run on the 1st of every month, every 2 hours starting at 00:30. '0 0 */5 * *' configures the schedule to run at midnight (00:00) every 5 days starting on the 5th of each month.
A comma-separated list of any of the above except the '*' wildcard is also supported '2,*/5,8-10'.'0 0 5,*/10,25 * *'Configures the schedule to run at midnight (00:00) every 5th, 10th, 20th, and 25th day of each month.
  1. (Optional) You can delay the start time of a query by enabling the Delay execution.

Execute the Query

Save the query with a name and run, or just run the query. Upon successful completion of the query, the query result is automatically exported to the specified destination.

Scheduled jobs that continuously fail due to configuration errors may be disabled on the system side after several notifications.

(Optional) You can delay the start time of a query by enabling the Delay execution.

Activate a Segment in Audience Studio

You can also send segment data to the target platform by creating an activation in the Audience Studio.

  1. Navigate to Audience Studio.
  2. Select a parent segment.
  3. Open the target segment, right-mouse click, and then select Create Activation.
  4. In the Details panel, enter an Activation name and configure the activation according to the previous section on Configuration Parameters.
  5. Customize the activation output in the Output Mapping panel.

  • Attribute Columns
    • Select Export All Columns to export all columns without making any changes.
    • Select + Add Columns to add specific columns for the export. The Output Column Name pre-populates with the same Source column name. You can update the Output Column Name. Continue to select + Add Columnsto add new columns for your activation output.
  • String Builder
    • + Add string to create strings for export. Select from the following values:
      • String: Choose any value; use text to create a custom value.
      • Timestamp: The date and time of the export.
      • Segment Id: The segment ID number.
      • Segment Name: The segment name.
      • Audience Id: The parent segment number.
  1. Set a Schedule.

  • Select the values to define your schedule and optionally include email notifications.
  1. Select Create.

If you need to create an activation for a batch journey, review Creating a Batch Journey Activation.

(Optional) Export Integration Using the CLI

You can also use CLI (Toolbelt) to export results to Snapchat Conversion CAPI.

You need to specify the information for export to your Snapchat server using the *--result option of*the td query command. For more information about the *td query*command, refer to this article.

The format of the option is JSON, and the general structure is as follows.

{
  "type": "snapchat_conversion",
  "auth_method": "oauth",
  "oauth_credentials_id": "xxxxxxxxxxx",
  "event_source_type": "web",
  "event_source_id": "xxxxxxxxxxx",
  "send_test_events": false,
  "skip_invalid_records": true
}
{
  "type": "snapchat_conversion",
  "auth_method": "api_token",
  "api_token": "xxxxxxxxxxx",
  "event_source_type": "web",
  "event_source_id": "xxxxxxxxxxx",
  "send_test_events": false,
  "skip_invalid_records": true
}

Parameters

NameDescriptionValueDefault ValueRequired
typeconnector typesnapchat_conversionN/AYes
auth_methodAuthentication methodSupported values: - oauth - api_tokenoauthYes
api_tokenConversion Api TokenN/AN/Ayes ( if the authentication method is Conversion Api Token)
oauth_credentials_idCredential id that was created by authentication method OAuth on the consoleN/AN/Ayes ( if the authentication method is oAuth)
event_source_typeevent source typeSupported event sources: - WEB - MOBILE_APP - OFFLINEWEBYes
event_source_idThe pixel id or application id on snapchat dashboard.N/AN/AYes
send_test_eventsSend data to Validation APItrue/falsefalseNo
skip_invalid_recordsThe flag to continue or stop the job when handling the invalid record.true/falsetrueNo

Example for Usage

OAuth authentication

$ td query --result '{"type":"snapchat_conversion","auth_method":"oauth","oauth_credentials_id":"xxx","event_source_type":"WEB","event_source_id":"xxx", "send_test_events":false,"skip_invalid_records":true}' -d sample_datasets "select ........ from ........" -T presto

API Token authentication

$ td query --result '{"type":"snapchat_conversion","auth_method":"api_token","api_token":"xxx","event_source_type":"WEB","event_source_id":"xxx", "send_test_events":false,"skip_invalid_records":true}' -d sample_datasets "select ........ from ........" -T presto

Other Configurations

  • The Result Export can be scheduled to periodically upload data to a target destination.
  • All import and export integrations can be added to a TD Workflow. The td data operator can export a query result to a specified integration. For more information, see Reference for Treasure Data Operators.