Skip to content
Last updated

Snapchat Import Integration

Snapchat allows you to easily communicate with friends, view live stories from around the world, and discover news via temporary pictures and video messaging. As a business, you can run Snapchat Ads Manager to create and manage ads and run campaigns to generate leads and more. Snapchat Import integration allows you to import lead generation report data from Snapchat.

Prerequisites

  • Basic knowledge of Treasure Data
  • A Snapchat business account

Requirements and Limitations

  • Import of only lead generation report data is supported.
  • Data collected from lead generation ads is not stored for more than 30 days. This means that the start time cannot be more than 30 days in the past.
  • The Snapchat Marketing API implements rate limits to ensure infrastructure stability. Rate limits are implemented both at App and Token level. The App supports an overall average volume of 20 requests per second while individual Access tokens issued by the App can make requests at an average of 10 requests per second.

Static IP Address of Treasure Data Integration

If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection.

Please find the complete list of static IP addresses, organized by region, at the following link:
https://api-docs.treasuredata.com/en/overview/ip-addresses-integrations-result-workers/

Get Snapchat Ads Account ID

  1. Go to https://ads.snapchat.com/.  Fill username and password, and click log in.
  2. After logging in, you can see your ad account ID from URL. For example, https://ads.snapchat.com/112345-3211-410f-test-1332433/create. Here, "112345-3211-410f-test-1332433" is your ad account ID.

Import from Snapchat via TD Console

Create Authentication

Your first step is to create a new authentication with a set of credentials.

  1. Select Integrations Hub.

  2. Select Catalog.

  1. Search for Snapchat in the Catalog; hover your mouse over the icon and select Create Authentication.

  1. Ensure that the Credentials tab is selected and then enter credential information for the integration Or select Click here to connect to a Snapchat account. You are redirected to Snapchat to login, if you haven't logged in yet, or to the consent page to grant access to Treasure Data.

ParameterDescription
Ad Account IDSnapchat Business Ad Account ID
  1. Enter a name for your authentication, and select Done.

Create a Source

  1. Open TD Console.

  2. Navigate to Integrations Hub > Authentications.

  3. Locate your new authentication and select New Source.

Create a Connection

Complete the following table for the source.

ParameterDescription
Data Transfer NameYou can define the name of your transfer.
AuthenticationThe authentication name that is used to a transfer.
  1. Type a source name in the Data Transfer Name field.

  2. Select Next.

The Create Source page displays with the Source Table tab selected.

Identify a Source Table

ParameterDescription
Data SourceObject data that will be import
Start TimeImport data since this time
End TimeImport data until this time
Incremental loadingWhether to enable incremental loading

Select Next.

Define Data Settings

ParameterDescription
Max wait time for report to completeMax wait time for report to complete in hours
Max retry count per API callMax retry count per API call
Initial retry interval per API callInitial retry interval per API call in seconds
Max retry interval per API callMax retry interval per API call in seconds

Select Next.

Data Preview

You can see a preview of your data before running the import by selecting Generate Preview. Data preview is optional and you can safely skip to the next page of the dialog if you choose to.

  1. Select Next. The Data Preview page opens.
  2. If you want to preview your data, select Generate Preview.
  3. Verify the data.

Data Placement

For data placement, select the target database and table where you want your data placed and indicate how often the import should run.

  1. Select Next. Under Storage, you will create a new or select an existing database and create a new or select an existing table for where you want to place the imported data.

  2. Select a Database > Select an existing or Create New Database.

  3. Optionally, type a database name.

  4. Select a TableSelect an existing or Create New Table.

  5. Optionally, type a table name.

  6. Choose the method for importing the data.

    • Append (default)-Data import results are appended to the table. If the table does not exist, it will be created.
    • Always Replace-Replaces the entire content of an existing table with the result output of the query. If the table does not exist, a new table is created.
    • Replace on New Data-Only replace the entire content of an existing table with the result output when there is new data.
  7. Select the Timestamp-based Partition Key column. If you want to set a different partition key seed than the default key, you can specify the long or timestamp column as the partitioning time. As a default time column, it uses upload_time with the add_time filter.

  8. Select the Timezone for your data storage.

  9. Under Schedule, you can choose when and how often you want to run this query.

Run once

  1. Select Off.
  2. Select Scheduling Timezone.
  3. Select Create & Run Now.

Repeat Regularly

  1. Select On.
  2. Select the Schedule. The UI provides these four options: @hourly@daily and @monthly or custom cron.
  3. You can also select Delay Transfer and add a delay of execution time.
  4. Select Scheduling Timezone.
  5. Select Create & Run Now.

After your transfer has run, you can see the results of your transfer in Data Workbench > Databases.

Import from Snapchat via Workflow

You can import data from Snapchat by using td_load>: operator of workflow. If you have already created a SOURCE, you can run it.

Using a Source

  1. Identify your source.

  2. To obtain a unique ID, open the Source list and then filter by product.

  3. Open the menu and select "Copy Unique ID".

  1. Define a workflow task using td_load> operator.
+load:
  td_load>: unique_id_of_your_source
  database: ${td.dest_db}
  table: ${td.dest_table}
  1. Run a workflow.