You can write job results from Arm Treasure Data directly to Snapchat. Use this data connector to create User Segments, upload data into existing segments, and remove users from a segment. The connector supports follow features:
- Add or remove users from multiple segments
- Auto-create a new segment if the segment does not exist
- Auto-detect and hash the user id (email, phone or mobile_ad_id) if the value is not hashed
- Specify an option to skip or stop on invalid values
- Basic knowledge of Treasure Data, including the TD toolbelt
- A valid Snapchat Ad Account account
- Authorized Treasure Data account access to Snapchat Marketing account
Use the TD Console to create your connection
Create a new connection
You must create and configure the data connection, to be used during export, prior to running your query. As part of the data connection, you provide authentication to access the integration.
Go to Catalog and search and select Snapchat.
The following dialog opens.
Authenticating your connection
Click on Click here to connect to a new account. You are redirected to Snapchat to login, if you haven't login yet, or to the consent page to grant access to Treasure Data.
You will be redirected back to TD console. Repeat the first step (Create a new connection) and choose your new OAuth connection.
Enter your Ad Account ID. See the Appendix: What is my Ad Account ID.
Click Continue and name your new Snapchat connection. Click Done.
Configure Export Results in Your Data Connection
In this step, you create or reuse a query. In the query, you configure the data connection.
Note: Sometimes you need to define the column mapping in the query.
Configure the Connection by Specifying the Parameters
Go to the TD console. Go to Data Workbench > Queries. Access the query that you plan to use to export data.
Click Export Results located at top of your query editor.
The Choose Integration dialog opens. You have two options when selecting a connection to use to export the results:
1. Use an existing connection
Type the connection name in the search box to filter and select your connection.
The dialog opens
2. Create a new Snapchat Connection
Click New Integration, select Snapchat from Type dropdown. You see the following:
Click Save and Continue. You see:
Complete the steps described in Create a new connection, including the creation of an OAuth connection.
Enter the required credentials for your new SnapChat connection.
Set the following parameters.
- Segment Operation (required): add or remove users from segments
- Skip Invalid Data: option to skip invalid rows and segments and to continue importing others. Invalid rows are listed in the job log. If this option is not selected, jobs terminate when an invalid record is encountered and uploaded data is not reverted.
- Max users uploaded per request (required): the maximum number of users uploaded in a single request. Default is 100000. Accepted value from 1-200000. If you specify more than 100000 users per request, you might receive an error message from Snapchat due to the limitation of uploaded users per request. The job splits the upload data into multiple requests based on this parameter. The query requests are processed until finished and all data is uploaded.
Column name for the Query
The Snapchat data connector understands and interprets only the following columns and data types. You must modify alias column names to match with the following specified columns:
|segment_id||string||optional||if both segment_id and segment_name are specified, the segment_id will be used.|
If the segment_name does not exist in Snapchat.
|retention_in_days||integer||optional||9999||Set default as 9999 if 0 or not specified. Accept value from 1 to 9999|
Must be either
|id_value||string||required||Either SHA256 hashed or raw value of email, phone, mobile_ad_id|
|You must include either segment_id or segment_name column in the Query otherwise your jobs fail.|
Example Queries to populate Snapchat Data
From Treasure Data, run the following query with export results into a connection for Snapchat:
The following example query uploads all emails to the existing Segments specified by segment_id if Segment Operation is specified as Add Users.
segment_id AS segment_id,
'email' AS id_type,
email AS id_value
The following example query checks for the segment Football fans or creates a new segment with a Retention of 30 days if Segment Operation is specified as Add Users.
'Football fans' AS segment_name,
30 AS retention_in_days,
'phone' AS id_type,
mobile_phone AS id_value
Optional: Use of Scheduled Jobs for Export
You can use Scheduled Jobs with Result Export to periodically write the output result to a target destination that you specify.
Q: Why the Reach in Snapchat Audiences list unchanged after I uploaded users?
- Snapchat takes up to 72 hours to process and match your uploaded users with its database. When the process is finished, the audience number is updated and the status is set to Ready.
Q: Why the Reach in Snapchat Audiences list increase after I remove users?
- After sending requests to remove users from Audiences list, Snapchat may show temporary uploaded users. You must wait until Snapchat finishes the process of matching and removing. The process can take up to 72 hours. The process is complete when you see the status set to Ready.
What is my Ad Account ID?
To find your Ad Account ID, log in your Business account, navigate to the Ad Account as shown in the following image. From there, you can see your Ad Account ID.
Find the Segment ID
When working with Segments, you need either Segment name or Segment ID. Here's how to find the Segment ID from your browser:
- Log into your Snapchat Ad Account
- Go to the Audiences section.
- Click on an existing Segment
- The Segment ID is on the address bar of your browser as follows: