---
title: "How to connect TikTok Ads to Databricks: setup and SQL"
canonical: "https://www.owox.com/blog/articles/how-to-connect-tiktok-ads-to-databricks"
updated: "2026-10-05"
---

# How to connect TikTok Ads to Databricks, step by step

To connect TikTok Ads to Databricks, create a connector Data Mart on a Databricks storage, sign in with TikTok, enter the advertiser IDs, choose the data level and the Ad Performance endpoint, and name the catalog, schema and table. The data level sets the grain of the table and should not be changed after the first load. The connector then refreshes the table on a schedule.

[Databricks](/blog/topics/databricks) · Updated October 1, 2026 · [Ievgen Krasovytskyi](/team/ievgen-krasovytskyi) · 8 min read

![How to connect TikTok Ads to Databricks, step by step](https://cdn.owox.ai/www/webflow/6a17306ebd13b9a306f1207f_TIKTOK-ADS-to-Databricks-1.png/public)

TikTok campaigns go live in a week. TikTok reporting usually takes much longer to arrive, and when it does it is a monthly export pasted next to the other channels.

This guide replaces the export with a table: TikTok Ads data in Databricks, loaded by the TikTok Ads connector in [OWOX Data Marts](https://www.owox.com/app-signup) and refreshed on a schedule. It follows the five setup screens, flags the one setting that cannot be changed afterwards, and ends with SQL validated against a table the connector loaded.

## What you end up with

A Delta table in your own Databricks workspace, `tiktok_ads_ad_insights`, with one row per ad per day by default: impressions, clicks, spend, conversions, video views and engagement.

The connector reads the TikTok Marketing API, writes that table and repeats on a schedule. It does not model the data. What you build on top, in SQL or a notebook, is yours.

## Before you start

### In TikTok

A TikTok for Business user assigned to the advertiser account, and the numeric **advertiser ID** from TikTok Ads Manager.

### In Databricks

A storage of type [Databricks](https://www.owox.com/data-storages/databricks) connected to your OWOX Data Marts project. The [storage guide](https://docs.owox.com/docs/storages/supported-storages/databricks/) asks for the workspace **host**, the **HTTP path** of a SQL warehouse and a **personal access token**. The token’s user needs permission to create schemas and tables in the catalog you choose, and to run queries on that warehouse.

The SQL warehouse behind the HTTP path does the work, so it sets the cost. Turn on auto stop and start small. [Databricks pricing](https://www.owox.com/blog/articles/databricks-pricing) shows what a short daily job is billed for.

## The Turning Point

OWOX Data Marts

See your first report built in real time. _15 minutes._

1.  Connect your data warehouse
2.  Pick your metrics
3.  Get a live Google Sheets report

In the time it takes to write a ticket. Then imagine never writing that ticket again.

[Book a Demo](/book-a-call)

We'll use your actual use case

## Step 1: create the Data Mart and choose the connector

Click **New Data Mart**, give it a title, pick the Databricks storage and click **Create Data Mart**. On the Data Setup tab, set **Definition Type** to **Connector**.

![Set Up Connector dialog in OWOX Data Marts, step 1 of 5, with TikTok Ads selected in a list that also shows Facebook Ads, Google Ads, LinkedIn Ads, Microsoft Ads, Reddit Ads, Shopify and X Ads – every source is set up through the same five screens](https://cdn.owox.ai/www/webflow/6a172a1ee8bdaa9903c01e49_c3f455ac.png/public)

Choose **TikTok Ads** and click **Next**.

## Step 2: sign in, enter the advertisers and choose the data level

**Continue with TikTok** is the short way. Sign in as a user who can access the advertiser account and approve access. It needs no developer app.

**Manually** means your own TikTok developer app: an access token, an App ID and an App Secret. TikTok reviews every app, which can take up to seven business days. The [credentials guide](https://docs.owox.com/packages/connectors/src/sources/tik-tok-ads/credentials/) covers it.

![Edit Connector form for TikTok Ads in OWOX Data Marts on a Databricks Data Mart, with a Continue with TikTok button, a Manually link, a required Advertiser IDs field and a Data Level selector set to AUCTION\_AD – the grain is chosen in the same form as the sign-in](https://cdn.owox.ai/www/content-marketing-article/how-to-connect-tiktok-ads-to-databricks/screens/1.png/public)

Fill in **Advertiser IDs** with the numbers only. Several advertisers go in one field, separated by commas or semicolons, and they all write into the same table.

### The data level

**Data Level** decides what one row of the performance table means. Get it right the first time.

*   **AUCTION\_AD**, the default. One row per ad per day.
*   **AUCTION\_ADGROUP.** One row per ad group per day.
*   **AUCTION\_CAMPAIGN.** One row per campaign per day.
*   **AUCTION\_ADVERTISER.** One row per advertiser per day.

The level also decides the keys the connector merges rows on, which is why you should **not change it after data has been loaded**. New rows would be matched on a different set of keys than the rows already in the table. If you need a second grain, create a second Data Mart with its own table.

For most reporting, keep the default. Ad level can always be summed up to campaigns. The reverse is not possible.

## Step 3: choose the endpoint

**Each Data Mart loads one endpoint.**

![Set Up Connector dialog in OWOX Data Marts, step 3 of 5, listing TikTok Ads endpoints with a description each: advertiser, campaigns, ad\_groups, ads, ad\_insights, ad\_insights\_by\_country and audiences – performance and structure are separate endpoints](https://cdn.owox.ai/www/webflow/6a172a1ee8bdaa9903c01e5a_3f25986f.png/public)

*   **`ad_insights`.** Daily performance at the data level you chose. The one for reporting.
*   **`ad_insights_by_country`.** The same, with a country breakdown.
*   **`campaigns`**, **`ad_groups`** and **`ads`.** Names, objectives, budgets, statuses and creative details.
*   **`advertiser`** and **`audiences`.** Account details and custom audiences.

## Step 4: choose the fields

The key fields for your data level are locked, and the panel says which ones.

![Connector Fields panel for TikTok Ads in OWOX Data Marts on a Databricks Data Mart, with 24 of 39 fields selected for ad\_insights, a note that required fields depend on the data level, and ad\_id, advertiser\_id and stat\_time\_day locked as keys – the keys follow from the grain chosen earlier](https://cdn.owox.ai/www/content-marketing-article/how-to-connect-tiktok-ads-to-databricks/screens/2.png/public)

Beyond impressions, clicks and spend, take the fields that are specific to TikTok: video views, two-second and six-second views, completions, and likes, comments, shares and follows.

## Step 5: name the catalog, schema and table

On Databricks the destination has three levels.

![Set Up Connector dialog in OWOX Data Marts, step 5 of 5, with Catalog name set to main, Schema name tiktok\_ads\_owox and Table name tiktok\_ads\_ad\_insights, each noted as created on first run if it does not exist – the destination is a three-level Unity Catalog name](https://cdn.owox.ai/www/webflow/6a172a1ee8bdaa9903c01e61_8bf4dfe2.png/public)

The setup proposes the catalog `main`, a schema named after the source and a table named after the endpoint. Each is created on the first run if it does not exist. If you load several ad platforms, pointing them all at one schema keeps later queries shorter.

Click **Save**, then **Publish & Run Data Mart**. The first run loads data from the first day of the previous month and can take several minutes.

![Data Setup tab of a published TikTok Ads connector Data Mart in OWOX Data Marts, showing the TikTokAds source with the ad\_insights endpoint and the Databricks catalog, schema and table it writes to – the data is in your workspace](https://cdn.owox.ai/www/webflow/6a172a1ee8bdaa9903c01e4d_06ad4bbe.png/public)

## Load history and set the schedule

### Backfill

Click **Manual Run** and choose **Backfill (custom period)**. One backfill run covers at most 31 days. For a longer history, run consecutive periods, each after the previous one has finished.

![Manual Run panel in OWOX Data Marts with Backfill (custom period) selected, start and end date fields and a note that a backfill run can cover at most 31 days – history is loaded one month at a time](https://cdn.owox.ai/www/content-marketing-article/how-to-connect-tiktok-ads-to-databricks/screens/3.png/public)

### Schedule

A Data Mart without a trigger does not run again. On the **Triggers** tab, add a trigger of type **Connector Run**: daily, weekly, monthly or at an interval.

![Triggers tab of a TikTok Ads Data Mart on Databricks in OWOX Data Marts, with a connector run scheduled daily at 08:00 and a report run daily at 09:00, each showing its next and last run – the load and the report that depends on it are scheduled an hour apart](https://cdn.owox.ai/www/content-marketing-article/how-to-connect-tiktok-ads-to-databricks/screens/4.png/public)

If a report reads from this Data Mart, schedule it after the connector run, as in the example above, so it picks up the fresh data.

Each scheduled run re-requests the days set by the **Reimport Lookback Window**, two by default. Impressions, clicks and spend settle within a day or two. Conversions keep arriving for as long as your attribution window, so if you report on them, set the lookback at least that long.

**Run History** shows every run with its time and status.

![Run History tab of a TikTok Ads Data Mart on Databricks in OWOX Data Marts, listing scheduled connector runs on consecutive days, each with a Success status – the daily load is visible and auditable](https://cdn.owox.ai/www/content-marketing-article/how-to-connect-tiktok-ads-to-databricks/screens/5.png/public)

One advanced setting to leave alone: **Create Empty Tables**. With it off, an account with no delivery yet gets no table, and later runs fail because the table is not found.

## What the table looks like in Databricks

**A three-level name, no quoting.** With the proposed names the table is `main.tiktok_ads_owox.tiktok_ads_ad_insights`. Names are not case-sensitive.

**The day is `stat_time_day`**, a date column.

**IDs, not names.** The table carries `campaign_id`, `adgroup_id` and `ad_id`. Names are in the `campaigns`, `ad_groups` and `ads` endpoints. Load the ones you need as separate Data Marts and join on the ID.

**Metrics are numbers.** `impressions`, `clicks`, `spend`, the video counts and the engagement counts can be summed directly.

**Keys and comments in the catalog.** The connector declares the keys as the table’s primary key and writes each field’s description as a column comment, so the table documents itself in Catalog Explorer.

## Query the data

All three queries were validated on a Databricks SQL warehouse against tables loaded by the connector. The examples use a shared schema, `ads_owox`, for all ad platforms.

Spend, clicks and cost per click by campaign and day, for the last 30 days:

```
SELECT
  stat_time_day AS date,
  campaign_id,
  SUM(impressions) AS impressions,
  SUM(clicks) AS clicks,
  SUM(spend) AS spend,
  SUM(spend) / NULLIF(SUM(clicks), 0) AS cpc
FROM main.ads_owox.tiktok_ads_ad_insights
WHERE stat_time_day >= date_sub(current_date(), 30)
GROUP BY stat_time_day, campaign_id
ORDER BY date, spend DESC;
```

How far people watch, by campaign:

```
SELECT
  campaign_id,
  SUM(impressions) AS impressions,
  SUM(video_views) AS video_views,
  SUM(video_watched_6s) AS views_6s,
  SUM(video_completion) AS completions,
  SUM(video_watched_6s)
    / NULLIF(SUM(video_views), 0) AS rate_6s,
  SUM(video_completion)
    / NULLIF(SUM(video_views), 0) AS completion_rate,
  SUM(spend) AS spend
FROM main.ads_owox.tiktok_ads_ad_insights
WHERE stat_time_day >= date_sub(current_date(), 30)
GROUP BY campaign_id
ORDER BY spend DESC;
```

TikTok next to LinkedIn, one row per day and channel:

```
SELECT
  stat_time_day AS date,
  'tiktok' AS channel,
  SUM(impressions) AS impressions,
  SUM(clicks) AS clicks,
  SUM(spend) AS spend
FROM main.ads_owox.tiktok_ads_ad_insights
GROUP BY stat_time_day

UNION ALL

SELECT
  dateRangeStart AS date,
  'linkedin' AS channel,
  SUM(impressions) AS impressions,
  SUM(clicks) AS clicks,
  SUM(costInUsd) AS spend
FROM main.ads_owox.linkedin_ads_ad_analytics
GROUP BY dateRangeStart;
```

Compute `cpc`, `ctr` and `cpm` from sums. The columns with those names hold the ratio for one ad on one day and cannot be averaged across rows.

## From table to report

The third query is worth more as a published definition than as a snippet. Save it as a SQL Data Mart and everyone reads the same unified spend table.

![SQL Data Mart in OWOX Data Marts on Databricks named Paid Social Spend (Daily), with the TikTok and LinkedIn union query in the editor and a “Valid SQL code” check – the cross-channel definition lives in one place](https://cdn.owox.ai/www/content-marketing-article/how-to-connect-tiktok-ads-to-databricks/screens/6.png/public)

On a Data Mart’s **Destinations** tab you attach reports to Google Sheets, Data Studio, Slack or email, each with its own columns and schedule. [Databricks to Google Sheets](https://www.owox.com/blog/articles/databricks-to-google-sheets) walks through the scheduled report and the self-service route for business users.

## Where to go next

The same five screens load the other sources into the same workspace: [Facebook Ads](https://www.owox.com/blog/articles/connect-facebook-ads-to-databricks), [Google Ads](https://www.owox.com/blog/articles/connect-google-ads-to-databricks) and [LinkedIn Ads](https://www.owox.com/blog/articles/how-to-connect-linkedin-ads-to-databricks).

On Snowflake the steps are the same and the naming rules differ: see [TikTok Ads to Snowflake](https://www.owox.com/blog/articles/tiktok-ads-data-snowflake). For the platform itself, start with [what Databricks is and how it works](https://www.owox.com/blog/articles/what-is-databricks).

## Your New Normal

Turn your data into decisions.

Governed data marts give you the clean foundation ML needs to actually work.

*   No AI hallucinations
*   Analyst-governed definitions
*   Every number traces to SQL

[Get started free](https://www.owox.com/app-signup)

## FAQ

## Frequently Asked Questions

What is the data level, and can I change it later?

The data level sets what one row of the performance table means: one ad, ad group, campaign or advertiser per day. It also sets the keys rows are merged on, so it should not be changed after data has been loaded into a table. For another grain, create a second Data Mart with its own table.

When do I need to reconnect TikTok in the connector?

After signing in with TikTok, OWOX Data Marts stores the token and uses it for scheduled runs. Reconnect when the user revokes access, TikTok invalidates the grant, the required permissions change, or the authorised user loses access to the advertiser account. Run History shows the error when a run fails for one of these reasons.

What is the Reimport Lookback Window in the TikTok Ads connector?

It is the number of days before the last imported date that each run requests again, two by default. Impressions, clicks and spend settle within a day or two. Conversions keep arriving for as long as your attribution window, so if you report on conversions, set the lookback at least as long as that window.

What TikTok Ads data can I import into Databricks with OWOX?

The ad\_insights endpoint gives daily performance at the data level you choose, and ad\_insights\_by\_country adds a country breakdown. The campaigns, ad\_groups and ads endpoints hold names, objectives, budgets and statuses. The advertiser and audiences endpoints hold account details and custom audiences. Each endpoint is loaded by its own Data Mart.

Do I need a TikTok developer app to connect TikTok Ads to Databricks?

No, not with the Continue with TikTok button: you sign in as a TikTok for Business user who can access the advertiser account and approve access. A developer app is only needed for the manual method, which takes an access token, an App ID and an App Secret. TikTok reviews every app, which can take up to seven business days.

## Who wrote this

![Ievgen Krasovytskyi](https://cdn.owox.ai/www/webflow/68404586b341508a789a4aa5_.png/public)

[Ievgen Krasovytskyi](/team/ievgen-krasovytskyi) · Head of Marketing

Ievgen Krasovytskyi is the Head of Marketing at OWOX, leading strategy across content, SEO, product marketing, and AI-powered automation. With deep expertise in analytics infrastructure, data warehouses, and marketing technology, he builds systems that connect marketing performance to business outcomes. Ievgen writes about SaaS growth, analytics workflows, and the future of AI in marketing operations.

[LinkedIn](https://www.linkedin.com/in/ievgen-krasovytskyi-a38a1253/) · [All articles](/team/ievgen-krasovytskyi)

[Databricks](/blog/topics/databricks)

## Related articles

[Databricks · What is Databricks and how does it work? · October 1, 2026](/blog/articles/what-is-databricks)

[Databricks · Databricks pricing explained: DBU rates, compute types and what drives your bill · October 1, 2026](/blog/articles/databricks-pricing)

[Databricks · How to connect Facebook Ads to Databricks, step by step · October 1, 2026](/blog/articles/connect-facebook-ads-to-databricks)

[See all articles →](/blog/articles)

## Book a call

You are booked. The invitation is on its way to , with the calendar invite and the meeting link.

[Reschedule](#)

[Cancel](#)

## Links

Pages this page links to, on this site and on docs.owox.com. Where the page has a Markdown twin, its address follows the link.

- [Databricks](https://www.owox.com/blog/topics/databricks) — /blog/topics/databricks.md
- [Ievgen Krasovytskyi](https://www.owox.com/team/ievgen-krasovytskyi) — /team/ievgen-krasovytskyi.md
- [OWOX Data Marts](https://www.owox.com/app-signup)
- [Databricks](https://www.owox.com/data-storages/databricks) — /data-storages/databricks.md
- [storage guide](https://docs.owox.com/docs/storages/supported-storages/databricks)
- [Databricks pricing](https://www.owox.com/blog/articles/databricks-pricing) — /blog/articles/databricks-pricing.md
- [Book a Demo](https://www.owox.com/book-a-call) — /book-a-call.md
- [credentials guide](https://docs.owox.com/packages/connectors/src/sources/tik-tok-ads/credentials)
- [Databricks to Google Sheets](https://www.owox.com/blog/articles/databricks-to-google-sheets) — /blog/articles/databricks-to-google-sheets.md
- [Facebook Ads](https://www.owox.com/blog/articles/connect-facebook-ads-to-databricks) — /blog/articles/connect-facebook-ads-to-databricks.md
- [Google Ads](https://www.owox.com/blog/articles/connect-google-ads-to-databricks) — /blog/articles/connect-google-ads-to-databricks.md
- [LinkedIn Ads](https://www.owox.com/blog/articles/how-to-connect-linkedin-ads-to-databricks) — /blog/articles/how-to-connect-linkedin-ads-to-databricks.md
- [TikTok Ads to Snowflake](https://www.owox.com/blog/articles/tiktok-ads-data-snowflake) — /blog/articles/tiktok-ads-data-snowflake.md
- [what Databricks is and how it works](https://www.owox.com/blog/articles/what-is-databricks) — /blog/articles/what-is-databricks.md
- [See all articles →](https://www.owox.com/blog/articles) — /blog/articles.md
