Ad Report
Generates an ad report by joining multiple tables from the TikTok Ads integration. It retrieves data such as impressions, clicks, spend, reach, conversions, likes, comments, shares, and various video metrics for each ad group. The report also includes information about the advertiser, campaign, account, currency, gender, audience type, and budget.
- Grain
- See the notes
- Built from
- 5Raw tables
- 1Staging
- Reads from Tiktok Ads
- adad_daily_reportad_groupadvertisercampaign
- Ships as
- Weld and dbt SQL, open source on GitHub
1-- staging.tiktok_ads.ad_report
2-- Ad Report. Generates an ad report by joining multiple tables from the TikTok Ads
3-- integration. It retrieves data such as impressions, clicks, spend, reach,
4-- conversions, likes, comments, shares, and various video metrics for each ad
5-- group. The report also includes information about the advertiser, campaign,
6-- account, currency, gender, audience type, and budget.
7--
8-- From the weld.app template library. Not reconciled against TikTok Ads;
9-- check the output against the source before relying on it.
10
11with
12 daily as (
13 select
14 *
15 from
16 {{raw.tiktok_ads.ad_daily_report}} -- to join another tiktok ads account
17 -- union all
18 -- select * from <second_account_table>
19 )
20 , ads as (
21 select
22 *
23 from
24 {{raw.tiktok_ads.ad}}
25 )
26 , ad_groups as (
27 select
28 *
29 from
30 {{raw.tiktok_ads.ad_group}}
31 )
32 , advertiser as (
33 select
34 *
35 from
36 {{raw.tiktok_ads.advertiser}}
37 )
38 , campaigns as (
39 select
40 *Refs like {{raw.…}} resolve to your synced tables in Weld; the dbt view uses source() instead.
How it counts. And where it stops.
Retrieves data from the TikTok Ads integration. It combines multiple tables, including ad_daily_report, ad, ad_group, advertiser, and campaign, to generate a comprehensive report on ad performance. This SQL template provides valuable insights into the performance of ads on TikTok. It retrieves data such as impressions, clicks, spend, reach, conversions, likes, comments, shares, profile visits, follows, video views, and engagement rates. By aggregating data at the daily level, it allows users to analyze the performance of different ad campaigns, ad groups, and individual ads. The template joins the relevant tables using left joins, ensuring that all available data is included in the report. It groups the data by various dimensions, including date, account, campaign, ad group, and ad, providing a granular view of performance metrics. Additionally, it calculates derived metrics such as cost per click (CPC), click-through rate (CTR), and cost per thousand impressions (CPM). By utilizing this SQL template, users can gain valuable insights into their TikTok ad campaigns. They can identify top-performing ads, optimize their targeting strategies, track campaign budgets, and measure the effectiveness of their ad spend. The generated report can be used to make data-driven decisions and improve overall advertising performance on TikTok.
Raw tables it reads
- raw.tiktok_ads.ad
- raw.tiktok_ads.ad_daily_report
- raw.tiktok_ads.ad_group
- raw.tiktok_ads.advertiser
- raw.tiktok_ads.campaign
Put Tiktok Ads in front
of your agents.
Connect Tiktok Ads, deploy the models, and ask questions in Claude, Cursor or ChatGPT. Free for 14 days, no credit card.