Estuary

How to Connect TikTok Ads to Redshift: A Step-by-Step Guide

Learn how to load TikTok Ads data into Amazon Redshift using a manual CSV, S3, and COPY workflow or an automated Estuary pipeline.

tiktok to redshift
Share this article

TikTok Ads data is valuable for campaign reporting, attribution analysis, ROAS tracking, and cross-channel marketing dashboards. But TikTok Ads Manager is not designed to be a long-term analytics warehouse, and exporting reports manually can become slow and error-prone as campaigns scale.

Amazon Redshift gives marketing and data teams a centralized place to store TikTok Ads performance data, join it with other business data, and run SQL-based analysis across campaigns, ad groups, ads, dates, spend, clicks, conversions, and revenue metrics.

In this guide, you’ll learn two ways to load TikTok Ads data into Amazon Redshift:

  • A manual CSV workflow using TikTok Ads Manager exports, Amazon S3, and Redshift’s COPY command.
  • An automated pipeline using Estuary’s TikTok Marketing source connector and Amazon Redshift destination connector.

The manual method is useful for one-time exports and ad hoc analysis. The Estuary method is better for recurring reporting, dashboards, and pipelines that need to stay up to date without repeated CSV exports.

Method 1: Manual CSV Export to Redshift

For one-time pulls or ad hoc analysis where setting up a pipeline is not worth the overhead.

Step 1: Export from TikTok Ads Manager

  1. Log in to TikTok Ads Manager
  2. Navigate to Reporting > Custom Reports or use the Campaign, Ad Group, or Ads tabs
  3. Select your date range, metrics, and dimensions
  4. Click Download and choose CSV

TikTok Ads Manager exports are flat CSV files. The grain of the file depends on the report type, selected dimensions, and date breakdown. For Redshift reporting, a daily campaign or ad group performance export is usually the most useful starting point.

Step 2: Upload to S3

bash
# Upload the CSV to your S3 bucket aws s3 cp tiktok_ads_report.csv s3://your-bucket/tiktok/tiktok_ads_report.csv

Or use the AWS S3 console to drag and drop the file into your bucket.

Step 3: Create a Table in Redshift and Load with COPY

First create the schema if it does not already exist, then create the target table. Your exact columns will depend on the report type and fields selected in TikTok Ads Manager. The following is an illustrative table for a daily campaign/ad group performance export:

sql
CREATE SCHEMA IF NOT EXISTS tiktok_ads; CREATE TABLE tiktok_ads.campaign_performance ( campaign_id VARCHAR(50), campaign_name VARCHAR(255), ad_group_id VARCHAR(50), ad_group_name VARCHAR(255), stat_date DATE, impressions INTEGER, clicks INTEGER, spend NUMERIC(12,2), conversions INTEGER, ctr NUMERIC(8,4), cpm NUMERIC(12,2), cpa NUMERIC(12,2) );

Then load with COPY. The additional options handle common TikTok export quirks like blank fields, quoted text, and date format variations:

Note: `TRUNCATECOLUMNS` prevents long text fields from failing the load, but it can also hide data quality issues. Remove it if you prefer Redshift to fail the load when values exceed the target column length.

sql
COPY tiktok_ads.campaign_performance FROM 's3://your-bucket/tiktok/tiktok_ads_report.csv' IAM_ROLE 'arn:aws:iam::account-id:role/your-redshift-role' FORMAT AS CSV IGNOREHEADER 1 DATEFORMAT 'auto' TIMEFORMAT 'auto' EMPTYASNULL BLANKSASNULL TRUNCATECOLUMNS REGION 'us-east-2';

Duplicate rows on repeated loads: Redshift's COPY appends rows to the target table. If you reload the same file, you will create duplicates. For repeat loads, delete the date range before reloading:

sql
DELETE FROM tiktok_ads.campaign_performance WHERE stat_date BETWEEN '2024-01-01' AND '2024-01-31';

Or use a staging table and deduplicate by campaign ID, ad group ID, and date before inserting into the final table.

Validate the load:

sql
-- Check row count SELECT COUNT(*) FROM tiktok_ads.campaign_performance; -- Check for load errors if row count seems wrong SELECT * FROM stl_load_errors ORDER BY starttime DESC LIMIT 10;

Honest limitation: This process needs to be repeated manually every time you want fresh data. TikTok's Ads Manager export also has row limits on large date ranges. For ongoing reporting, the Estuary pipeline is the better path.

Method 2: Automated Pipeline with Estuary

Estuary can automate the TikTok Ads to Redshift pipeline by capturing TikTok Marketing data and materializing it into Amazon Redshift.

Prerequisites for Using Estuary

Before creating the pipeline, make sure you have the following.

TikTok Marketing prerequisites

  • A TikTok for Business account.
  • Access to the advertiser accounts you want to replicate.
  • For production accounts, OAuth access through the Estuary web app.
  • For sandbox accounts, a sandbox access token and advertiser ID.

Amazon Redshift prerequisites

  • A Redshift cluster that Estuary can access directly or through an SSH tunnel.
  • A Redshift database user with permission to create and write to tables.
  • An Amazon S3 bucket for temporary staging files.
  • AWS credentials with read and write access to the S3 staging bucket.
  • The Redshift endpoint, port, database name, username, password, S3 bucket name, and AWS region.

Step 1: Authenticate with TikTok

Authentication differs depending on your account type:

  • Production account (most users): Estuary uses OAuth2. During capture setup you will click Sign in with TikTok and authorize access. No additional credentials needed beforehand.
  • Sandbox account (for testing): OAuth2 is not available for sandbox accounts. You will authenticate using an access token and advertiser ID instead. To get these: log in to your TikTok for Business account, navigate to the developer portal, create an application, and generate a sandbox access token. Note the advertiser ID from your sandbox ad account.

Step 2: Create the TikTok Marketing Capture

Estuary Step 1.1
  • Navigate to Sources and click + New Capture
Estuary Step 1.2
  • Search for TikTok Marketing and select it
Estuary step 1.3
  • Give the capture a unique name.
  • Fill in the configuration fields:
    • Start Date: the earliest date to pull historical data from (format: YYYY-MM-DD). Data before this date is not replicated.
    • End Date: optional. Leave blank to sync data up to the current date.
    • Attribution Window: default is 3 days. Increase if your campaigns use longer attribution windows (e.g., 7-day or 28-day click attribution).
    • Authentication: for production accounts, click Sign in with TikTok. For sandbox accounts, enter your access token and advertiser ID.
estuary step 1.4
  • Click Next. Estuary discovers available streams based on your account type and permissions.
  • Review the discovered streams. Deselect any you do not need.
  • Click Save and Publish. The initial backfill begins immediately.

Step 3: Create the Redshift Materialization

Before starting this step, confirm you have completed the S3 staging bucket setup and IAM user credentials from the prerequisites section above.

  • After the capture is published, navigate to Destinations and click + New Materialization
  • Search for Amazon Redshift and select it
Estuary Step 2.1
  • Fill in the endpoint configuration:
    • Address: your Redshift cluster endpoint and port (e.g., your-cluster.account.us-east-2.redshift.amazonaws.com:5439)
    • User: Redshift database user with CREATE TABLE and INSERT privileges
    • Password: password for that user
    • Database: target Redshift database name
    • AWS Access Key ID: the access key for your IAM user
    • AWS Secret Access Key: the secret key for your IAM user
    • Bucket: the S3 staging bucket name
    • Region: AWS region of both the S3 bucket and Redshift cluster (e.g., us-east-2)
Estuary Step 2.3
  • Click Next. Estuary maps TikTok collections to Redshift tables.
  • Review the table mapping. Each TikTok stream becomes a separate table.
  • Click Save and Publish.

Estuary loads the initial backfill, then keeps the Redshift tables updated as new TikTok Marketing data becomes available. Because ad platform reporting data can arrive with delay or change after the initial reporting date, choose an attribution window and sync schedule that match your reporting needs.

For more help, see the Estuary documentation for:

Conclusion

Loading TikTok Ads data into Amazon Redshift gives marketing and data teams a better way to analyze campaign performance, monitor spend, track conversions, and combine ad data with revenue or customer data.

For one-time analysis, the manual CSV method is usually enough: export a report from TikTok Ads Manager, upload it to Amazon S3, and load it into Redshift with the COPY command. However, this approach requires repeated manual exports, careful duplicate handling, and ongoing schema management.

For recurring reporting and production dashboards, Estuary is the better option. Estuary captures TikTok Marketing data, handles ongoing syncs, and materializes the data into Redshift without requiring teams to manually export and reload CSV files.

Start streaming your data for free

Build a Pipeline

About the author

Picture of Jeffrey Richman
Jeffrey RichmanData Engineering & Growth Specialist

Jeffrey is a data engineering professional with over 15 years of experience, helping early-stage data companies scale by combining technical expertise with growth-focused strategies. His writing shares practical insights on data systems and efficient scaling.

Streaming Pipelines.
Simple to Deploy.
Simply Priced.
$0.50/GB of data moved + $.14/connector/hour;
50% less than competing ETL/ELT solutions;
<100ms latency on streaming sinks/sources.