Skip to main content

TikTok Ads

Elton lấy dữ liệu quảng cáo TikTok qua TikTok API for Business (phiên bản v1.3): báo cáo quảng cáo theo campaign, ad group, ad, đối tượng, catalog, playable; danh sách campaign, ad group, ad; thông tin tài khoản quảng cáo; báo cáo creative; báo cáo GMV Max; và hoá đơn của Business Center. Elton chỉ đọc, không tạo hay sửa dữ liệu trên TikTok Ads.

Dữ liệu shop TikTok Shop (đơn hàng, sản phẩm, quyết toán…) là source riêng, xem TikTok Shop.

1. Tạo data source và trao quyền​

Bước 1: Tạo data source TikTok Ads​

  1. Vào Data Sources → Create data source, ở ô Type chọn TikTok Ads.
  2. Điền form:
TrườngGiá trị
NameTên hiển thị của source, ví dụ TikTok Ads Elton
DescriptionMô tả, không bắt buộc
App typeElton app (mặc định): dùng ứng dụng TikTok for Business của Elton. Custom app: dùng ứng dụng TikTok for Business của riêng bạn
App IDChỉ có khi chọn Custom app, bắt buộc. App ID của ứng dụng
App secretChỉ có khi chọn Custom app, bắt buộc. Secret của ứng dụng
  1. Bấm Create data source. Elton mở trang chi tiết của source vừa tạo.

Bước 2: Trao quyền cho Elton (TikTok Ads)​

  1. Ở trang chi tiết source, bấm Authorize with TikTok.
  2. Elton chuyển sang trang trao quyền của TikTok for Business (ads.tiktok.com). Đăng nhập bằng tài khoản TikTok for Business có quyền vào các tài khoản quảng cáo (advertiser) cần lấy dữ liệu, chọn quyền và xác nhận.
  3. TikTok đưa bạn về trang chi tiết source. Mục Advertisers available to connections liệt kê các tài khoản quảng cáo mà lần trao quyền cho phép, dạng <tên tài khoản> (<advertiser ID>). Nút đổi thành Re-authorize.

Một source dùng được cho nhiều tài khoản quảng cáo: bạn chọn tài khoản nào cần lấy ở từng connection (mục 2). Nếu tài khoản cần lấy không có trong danh sách, cấp quyền cho nó trên TikTok rồi bấm Re-authorize và làm lại bước 2.

Quyền truy cập TikTok Ads không có thời hạn: nó còn hiệu lực cho đến khi bị thu hồi trên TikTok (ví dụ người trao quyền mất quyền vào tài khoản, hoặc huỷ quyền của ứng dụng). Khi đó các lần chạy lỗi cho đến khi bạn bấm Re-authorize.

2. Tạo connection TikTok Ads​

Service type (TikTok Ads)​

Ô Service type quyết định loại dữ liệu của connection:

  • Ads Reporting (mặc định): báo cáo quảng cáo, danh sách campaign/ad group/ad, thông tin tài khoản, báo cáo creative, báo cáo GMV Max. Chọn tài khoản quảng cáo và Report type như bên dưới.
  • Business Center: hoá đơn (invoice) của Business Center, xem Connection Business Center.

Chọn tài khoản quảng cáo (TikTok Ads)​

  • Select Ads accounts: bắt buộc. Chọn một hoặc nhiều tài khoản quảng cáo trong số các tài khoản mà source được trao quyền. Nhãn hiện số đã chọn trên tổng số, ví dụ (3/10 selected). Danh sách trống thường do source chưa được trao quyền, hoặc trình chặn quảng cáo (ad block) của trình duyệt chặn việc tải danh sách: form có cảnh báo Do not use ad block in your browser or it may conflicts with account retrieval!.
  • Tài khoản đã chọn nhưng không còn trong danh sách được trao quyền (bị gỡ, hoặc mất quyền) là tài khoản không hợp lệ. Form hiện cảnh báo Invalid accounts detected due to account removal or revoked permissions!… kèm danh sách, và nút Remove invalid accounts để bỏ chúng khỏi connection.
  • Ignore invalid accounts: công tắc này chỉ đổi cảnh báo trên form (từ lỗi sang lưu ý), không chặn hay thay đổi việc lưu connection. Khi chạy, dù bật hay tắt, Elton bỏ qua các tài khoản mà TikTok báo là không có quyền truy cập (mã 40001) ở bước đọc thông tin tài khoản và tiếp tục với các tài khoản còn lại.

Ở bản cài đặt riêng (self-hosted), form có thêm ô Account ID source: Select from dropdown (chọn như trên) hoặc Query from BigQuery (nhập câu SQL ở Account ID query trả về một cột advertiser ID, ví dụ SELECT advertiser_id FROM project.dataset.tiktok_ads_accounts). Với Query from BigQuery, Elton chạy câu SQL ở mỗi lần chạy để lấy danh sách tài khoản; với Report type GMV Max, Elton cũng tự lấy các store GMV Max đang hoạt động của các tài khoản đó thay cho ô GMV Max stores.

Report type, Data level, Dimensions, Metrics (TikTok Ads)​

  • Report type: bắt buộc. Một connection lấy một report type:
Report typeLấy gìCần thêm
Account InfoThông tin từng tài khoản quảng cáo đã chọnKhông cần Data level, Dimensions, Metrics
BasicBáo cáo hiệu quả quảng cáoData level, Dimensions, Metrics
AudienceBáo cáo theo đối tượng (tuổi, giới tính, vị trí…)Data level, Dimensions, Metrics
Playable MaterialBáo cáo theo playableData level, Dimensions, Metrics
CatalogBáo cáo theo catalog sản phẩmData level, Dimensions, Metrics
GMV MaxBáo cáo chiến dịch GMV MaxGMV Max report, GMV Max stores (xem GMV Max)
CreativeBáo cáo theo creative (video, ảnh)Creative report type: Creative Basic Report (cần Dimensions, Metrics) hoặc Creative Video Insights Report (cột cố định)
  • Data level: bắt buộc với Basic, Audience, Playable Material, Catalog. Cấp dữ liệu của báo cáo: nhóm Auction Ads (AUCTION_AD, AUCTION_ADVERTISER, AUCTION_ADGROUP, AUCTION_CAMPAIGN) hoặc Reservation Ads (RESERVATION_AD, RESERVATION_ADVERTISER, RESERVATION_ADGROUP, RESERVATION_CAMPAIGN). Data level cũng quyết định bảng danh sách đi kèm (xem Bảng danh sách).
  • Dimensions: bắt buộc. Các dimension, cách nhau bằng dấu phẩy, ví dụ campaign_id, stat_time_day. Dimension là thuộc tính để nhóm số liệu (ngày, campaign, tuổi…). Dimension hợp lệ của từng report type xem ở link TikTok Ads Document ngay trên ô nhập.
  • Metrics: bắt buộc. Các metric, cách nhau bằng dấu phẩy, ví dụ spend, impressions, reach, clicks. Metric là số đo (chi phí, lượt hiển thị…). Metric hợp lệ xem ở link TikTok Ads Document trên ô nhập.

Đổi Report type (hoặc Creative report type) thì Dimensions và Metrics bị xoá trắng. Hai nút giúp điền nhanh:

  • Fill basic configs: điền Report type BASIC, Data level AUCTION_CAMPAIGN, Dimensions stat_time_day, campaign_id, country_code, Metrics clicks, impressions, reach, spend.
  • Fill basic configs for report type <tên report type>: điền cấu hình mẫu của report type đang chọn:
Report typeData levelDimensionsMetrics
BasicAUCTION_CAMPAIGNstat_time_day, campaign_idclicks, impressions, spend, cpc, cpm, ctr, conversion, cost_per_conversion, conversion_rate
AudienceAUCTION_ADVERTISERstat_time_day, age, genderclicks, impressions, spend, cpc, cpm, ctr, conversion, cost_per_conversion, conversion_rate
Playable MaterialAUCTION_CAMPAIGNplayable_id, country_codespend, cpm, impressions, clicks, ctr, conversion, cost_per_conversion, conversion_rate
CatalogAUCTION_CAMPAIGNstat_time_day, catalog_id, product_idconversion
Creative Basic Report(không có)material_id, video_id, image_id, page_idspend, cpc, cpm, impressions, clicks, ctr, conversion, cost_per_conversion, conversion_rate
tip

Muốn số liệu theo ngày, hãy có stat_time_day trong Dimensions. Khi có stat_time_day, bảng báo cáo được phân vùng (partition) theo cột này. Không có dimension ngày thì mỗi dòng là tổng của một đoạn 3 ngày mà Elton gọi, các dòng cùng khoá ghi đè nhau, nên số liệu không cộng dồn được.

First run loads from và Later runs rescan (TikTok Ads)​

  • First run loads from: không bắt buộc. Ngày bắt đầu lấy ở lần chạy đầu tiên. Để trống thì lần chạy đầu chỉ lấy lùi lại số ngày của Later runs rescan (hoặc số ngày mặc định, xem mục 3) tính từ hôm nay.
  • Later runs rescan: các lần chạy sau, Elton lấy từ ngày của lần chạy trước (theo giờ UTC), lùi lại số ngày này: Last 1 day, Last 3 days, Last 7 days, Last 30 days, Last 60 days, Last 90 days, Last 120 days, Last 150 days hoặc Last 180 days. Số liệu quảng cáo những ngày gần đây còn được TikTok cập nhật (chuyển đổi đến muộn), nên lấy lại vài ngày giúp số liệu đúng hơn.

Riêng Creative và GMV Max với Elton app: Elton luôn lấy lại 3 ngày, không theo Later runs rescan, và giới hạn số ngày lấy lại (xem mục 3). Với Custom app, hai loại này theo Later runs rescan và không bị Elton giới hạn.

Bản ghi được cập nhật theo khoá của bảng: lấy lại cùng một bản ghi thì dòng cũ được thay, không bị nhân đôi.

Connection Business Center (TikTok Ads)​

Khi Service type là Business Center:

  • Select 1 or many business centers: bắt buộc. Danh sách Business Center mà source được trao quyền, dạng <tên> - <loại> - <trạng thái>. Business Center loại NORMAL không chọn được: TikTok chỉ cho lấy hoá đơn của Business Center có loại khác NORMAL (form ghi Only business centers whose type is not NORMAL are able to get invoice.).
  • Select 1 or many type of data: bắt buộc. Hiện có một loại: Invoice.
  • Load data since: chọn năm bắt đầu lấy hoá đơn ở lần chạy đầu (Elton lấy từ ngày 1/1 của năm đó). Connection mới đã có sẵn ngày mặc định (hôm qua), nên nếu bạn không chọn năm, lần chạy đầu lấy từ 1/1 của năm chứa ngày hôm qua. Muốn lấy hoá đơn các năm trước, hãy chọn năm cụ thể.

3. TikTok Ads: dữ liệu được đồng bộ​

Report type / loạiBảngKhoáLấy lại (rescan)Giới hạnPhân vùng (partition) theo ngày
Basic, Audience, Playable Material, Catalog<tên bảng> (xem Tên bảng)account_id và mọi dimension đã nhậpTheo Later runs rescan, mặc định 1 ngàystat_time_day (nếu có trong Dimensions)
(đi kèm 4 report type trên)<tên bảng>_campaign, <tên bảng>_adgroup hoặc <tên bảng>_adaccount_id, campaign_id / adgroup_id / ad_idDanh sách mỗi lần chạycreate_time
Account Infotiktok_ads_account_infoadvertiser_idToàn bộ tài khoản đã chọn, mỗi lần chạy
Creative → Creative Basic Reporttiktok_ads_creative_basic_reportaccount_id, mọi dimension đã nhập, record_dateElton app: luôn 3 ngày. Custom app: theo Later runs rescan, mặc định 3 ngàyElton app: 180 ngày trướcrecord_date
Creative → Creative Video Insights Reporttiktok_ads_creative_video_insights_reportaccount_id, material_id, record_dateNhư Creative Basic ReportElton app: 180 ngày trướcrecord_date
GMV Max → All GMV Max Campaigns Overviewtiktok_ads_gmv_max_campaign_overview_reportaccount_id, store_id, stat_time_dayElton app: luôn 3 ngày. Custom app: theo Later runs rescan, mặc định 3 ngàyElton app: 365 ngày trướcstat_time_day
GMV Max → Product GMV Max - Campaign leveltiktok_ads_gmv_max_product_campaign_level_reportaccount_id, store_id, campaign_id, stat_time_dayNhư trênElton app: 365 ngày trướcstat_time_day
GMV Max → Product GMV Max - Product leveltiktok_ads_gmv_max_product_product_level_reportaccount_id, store_id, campaign_id, stat_time_day, item_group_idNhư trênElton app: 30 ngày trướcstat_time_day
GMV Max → Product GMV Max - Creative leveltiktok_ads_gmv_max_product_creative_level_reportaccount_id, store_id, campaign_id, item_group_id, item_id, stat_time_dayNhư trênElton app: 30 ngày trướcstat_time_day
GMV Max → Live GMV Max - Campaign leveltiktok_ads_gmv_max_live_campaign_reportaccount_id, store_id, campaign_id, stat_time_dayNhư trênElton app: 365 ngày trướcstat_time_day
GMV Max → Live GMV Max - Livestream leveltiktok_ads_gmv_max_live_livestream_reportaccount_id, store_id, campaign_id, stat_time_day, room_idNhư trênElton app: 30 ngày trướcstat_time_day
Business Center → Invoicetiktok_ads_business_center_invoicebusiness_center_id, invoice_idNăm trước và năm nay, mỗi lần chạysend_date

"Giới hạn" là số ngày cũ nhất Elton lấy khi dùng Elton app: First run loads from cũ hơn thì Elton bắt đầu từ mốc đó.

warning

Các bảng có tên cố định (tiktok_ads_account_info, tiktok_ads_creative_…, tiktok_ads_gmv_max_…, tiktok_ads_business_center_invoice) dùng chung cho mọi connection TikTok Ads ghi vào cùng một dataset. Dữ liệu của các connection khác nhau nằm chung bảng, phân biệt bằng account_id (hoặc business_center_id). Muốn tách, cho các connection ghi vào Destination dataset khác nhau.

Cột elton_created_at (thời điểm Elton lấy bản ghi) có trong danh sách cột của từng bảng, nhưng trên BigQuery chỉ được ghi khi connection dùng kiểu ghi Append. Với Merge (cập nhật theo khoá) và Overwrite, bảng ở BigQuery không có cột này. Các cột dạng danh sách được lưu ở BigQuery là cột lặp (REPEATED STRING).

Tên bảng báo cáo (TikTok Ads)​

Với Report type Basic, Audience, Playable Material, Catalog, tên bảng do connection quyết định:

  • <tên bảng> là Destination table name ở cấu hình nâng cao của destination (viết thường, ký tự đặc biệt thành _). Để trống thì khi tạo connection Elton đặt tên mặc định dạng tiktok_ads_<8 ký tự ngẫu nhiên>, ví dụ tiktok_ads_1a2b3c4d.
  • Bảng danh sách đi kèm có thêm hậu tố theo Data level, ví dụ tiktok_ads_1a2b3c4d_campaign.

Mỗi connection có tên bảng riêng, nên các connection Basic/Audience/Playable Material/Catalog không ghi đè lên nhau.

Báo cáo Basic, Audience, Playable Material, Catalog (TikTok Ads)​

Elton gọi báo cáo của TikTok cho từng tài khoản đã chọn, theo Report type, Data level, Dimensions, Metrics của connection, chia khoảng lấy thành từng đoạn 3 ngày. Elton thêm bộ lọc trạng thái STATUS_ALL theo Data level (campaign, ad group hoặc ad) để lấy đối tượng ở mọi trạng thái; Report type Playable Material và Data level AUCTION_ADVERTISER không có bộ lọc này.

Mỗi dòng gồm:

  • account_id, account_name: tài khoản quảng cáo (advertiser ID và tên).
  • Mỗi dimension đã nhập là một cột, ví dụ stat_time_day, campaign_id, age.
  • Mỗi metric đã nhập là một cột, ví dụ spend, impressions, clicks.
  • elton_created_at.

Tất cả cột của <tên bảng>: account_id, account_name, các dimension và metric bạn nhập ở Dimensions và Metrics (sắp theo thứ tự chữ cái), elton_created_at. Ví dụ với cấu hình của nút Fill basic configs: account_id, account_name, campaign_id, clicks, country_code, impressions, reach, spend, stat_time_day, elton_created_at.

Kiểu dữ liệu ở BigQuery được suy ra từ dữ liệu. Các cột thường gặp: account_id, campaign_id là số nguyên (INTEGER), stat_time_day là TIMESTAMP, spend, cpc, cpm, ctr, conversion_rate, cost_per_conversion, billed_cost là số thực, clicks, impressions, conversion là số nguyên.

Báo cáo không có tên campaign/ad group/ad (trừ khi bạn thêm metric tên tương ứng): nối với bảng danh sách đi kèm để có tên (xem mục 4).

Bảng danh sách campaign, ad group, ad (TikTok Ads)​

Với Report type Basic, Audience, Playable Material, Catalog, mỗi lần chạy Elton còn lấy danh sách đối tượng quảng cáo của từng tài khoản đã chọn, ở mọi trạng thái, ghi vào một bảng theo Data level:

Data levelBảngKhoá
AUCTION_CAMPAIGN<tên bảng>_campaignaccount_id, campaign_id
AUCTION_ADGROUP<tên bảng>_adgroupaccount_id, adgroup_id
AUCTION_AD<tên bảng>_adaccount_id, ad_id
Các Data level khác (AUCTION_ADVERTISER, RESERVATION_…)<tên bảng>_campaignaccount_id, campaign_id

Muốn có cả ba bảng campaign, ad group và ad, tạo ba connection với ba Data level AUCTION_CAMPAIGN, AUCTION_ADGROUP, AUCTION_AD.

Ở các bảng này, account_id, campaign_id, adgroup_id, ad_id là chuỗi (STRING).

CộtÝ nghĩa
account_id, account_nameTài khoản quảng cáo
campaign_id, campaign_nameCampaign
adgroup_id, adgroup_nameAd group (bảng _adgroup và _ad)
ad_id, ad_nameAd (bảng _ad)
create_time, modify_timeThời điểm tạo, sửa
operation_status, secondary_statusTrạng thái bật/tắt và trạng thái phân phối
objective_type, budget, budget_modeMục tiêu và ngân sách (bảng _campaign)
optimization_goal, bid_type, bid_price, placements, location_ids, age_groups, genderTối ưu, giá thầu, vị trí, nhắm mục tiêu (bảng _adgroup)
ad_text, video_id, image_ids, landing_page_url, call_to_actionNội dung quảng cáo (bảng _ad)

Tất cả cột của <tên bảng>_campaign: account_id, account_name, campaign_id, campaign_name, campaign_type, create_time, modify_time, secondary_status, rf_campaign_type, operation_status, objective, deep_bid_type, objective_type, app_promotion_type, budget_mode, is_new_structure, is_smart_performance_campaign, budget, roas_bid, elton_created_at

Tất cả cột của <tên bảng>_adgroup: account_id, account_name, campaign_id, campaign_name, adgroup_id, adgroup_name, create_time, modify_time, deep_bid_type, schedule_type, category_id, secondary_optimization_event, schedule_end_time, device_price_ranges, pacing, catalog_id, device_model_ids, frequency_schedule, budget, purchased_impression, schedule_start_time, promotion_type, contextual_tag_ids, excluded_audience_ids, audience_ids, excluded_custom_actions, deep_cpa_bid, statistic_type, interest_keyword_ids, adgroup_app_profile_page_state, identity_type, included_custom_actions, frequency, languages, comment_disabled, app_id, conversion_bid_price, identity_id, purchased_reach, placement_type, is_hfss, inventory_filter_enabled, rf_estimated_frequency, network_types, app_download_url, video_download_disabled, gender, interest_category_ids, dayparting, keywords, share_disabled, actions, feed_type, bid_type, pixel_id, rf_purchased_type, brand_safety_type, next_day_retention, rf_estimated_cpr, store_id, delivery_mode, store_authorized_bc_id, optimization_goal, app_type, ios14_quota_type, budget_mode, creative_material_mode, operation_status, optimization_event, bid_display_mode, brand_safety_partner, search_result_enabled, is_new_structure, bid_price, location_ids, conversion_window, secondary_status, household_income, operating_systems, billing_event, skip_learning_phase, scheduled_budget, schedule_infos, placements, age_groups, identity_authorized_bc_id, elton_created_at

Tất cả cột của <tên bảng>_ad: account_id, account_name, campaign_id, campaign_name, adgroup_id, adgroup_name, ad_id, ad_name, create_time, modify_time, landing_page_url, item_group_ids, app_name, creative_type, brand_safety_postbid_partner, is_new_structure, optimization_event, ad_texts, call_to_action_id, card_id, tiktok_item_id, impression_tracking_url, landing_page_urls, viewability_vast_url, secondary_status, page_id, identity_type, ad_text, call_to_action, click_tracking_url, video_id, image_ids, vast_moat_enabled, product_set_id, is_aco, catalog_id, viewability_postbid_partner, playable_url, identity_id, profile_image_url, brand_safety_vast_url, deeplink, avatar_icon_web_uri, creative_authorized, ad_format, music_id, promotional_music_disabled, operation_status, display_name, elton_created_at

Account Info (TikTok Ads)​

Report type Account Info lấy thông tin của từng tài khoản quảng cáo đã chọn, mỗi lần chạy. Không theo ngày: First run loads from và Later runs rescan không áp dụng. Bảng tiktok_ads_account_info dùng chung cho mọi connection Account Info ghi vào cùng dataset.

CộtÝ nghĩa
advertiser_id, nameMã và tên tài khoản quảng cáo (trùng account_id, account_name ở các bảng khác)
status, role, rejection_reasonTrạng thái, vai trò, lý do bị từ chối
currency, timezone, display_timezoneTiền tệ và múi giờ của tài khoản
balanceSố dư
company, industry, country, address, email, contacterThông tin doanh nghiệp và liên hệ
create_timeThời điểm tạo tài khoản (UTC)
owner_bc_idBusiness Center sở hữu tài khoản

Tất cả cột của tiktok_ads_account_info: advertiser_id, name, telephone_number, contacter, currency, cellphone_number, timezone, role, company, status, description, rejection_reason, address, language, industry, license_no, email, license_url, country, balance, create_time, display_timezone, owner_bc_id, elton_created_at

Creative Basic Report (TikTok Ads)​

Report type Creative, Creative report type = Creative Basic Report. Số liệu theo từng creative (video và ảnh), theo ngày. TikTok không trả ngày trong báo cáo này, nên Elton gọi từng ngày một và ghi ngày đó vào cột record_date. Dòng mà mọi dimension đều trống (-) bị bỏ qua.

Dimensions và Metrics do bạn nhập và là ô bắt buộc. Nút Fill basic configs for report type Creative Basic Report điền sẵn material_id, video_id, image_id, page_id và spend, cpc, cpm, impressions, clicks, ctr, conversion, cost_per_conversion, conversion_rate. Metric có tên bắt đầu bằng chữ số được đổi tên thêm tiền tố metric_.

Ngoài dimension và metric, Elton lấy thêm thông tin của creative: material_id, ad_ids (các ad dùng creative), video_id, image_id, ad_text, call_to_action, cover_url, preview_url, duration, width, height.

Tất cả cột của tiktok_ads_creative_basic_report: account_id, account_name, các dimension và metric bạn nhập, material_id, ad_ids, video_id, image_id, ad_text, call_to_action, cover_url, preview_url, duration, width, height, record_date, elton_created_at. Với cấu hình điền sẵn ở trên, bảng có: account_id, account_name, material_id, record_date, ad_ids, video_id, image_id, page_id, ad_text, call_to_action, cover_url, preview_url, duration, width, height, spend, cpc, cpm, impressions, clicks, ctr, conversion, cost_per_conversion, conversion_rate, elton_created_at.

Creative Video Insights Report (TikTok Ads)​

Report type Creative, Creative report type = Creative Video Insights Report. Chỉ creative video, cột cố định (không nhập Dimensions, Metrics). Mỗi dòng là một video (material_id) của một tài khoản trong một ngày (record_date).

CộtÝ nghĩa
material_id, video_id, ad_idsCreative, video, các ad dùng video
record_dateNgày của số liệu
spend, impressions, clicks, ctr, cpc, cpm, conversion, cost_per_conversionSố liệu cơ bản
video_play_actions, video_watched_2s, video_watched_6s, video_views_p25, video_views_p50, video_views_p75, video_views_p100, average_video_playLượt phát và tỉ lệ xem hết video
reach, frequencySố người tiếp cận, tần suất
likes, comments, shares, follows, profile_visitsTương tác
engaged_view, engaged_view_15s, cost_per_engaged_viewLượt xem có tương tác
vta_conversion, cta_conversionChuyển đổi sau khi xem (VTA) và sau khi click (CTA)

Tất cả cột của tiktok_ads_creative_video_insights_report: account_id, account_name, material_id, record_date, ad_ids, video_id, video_cover_url, preview_url, duration, width, height, spend, cpc, cpm, impressions, clicks, ctr, conversion, cost_per_conversion, video_play_actions, video_watched_2s, video_watched_6s, average_video_play, average_video_play_per_user, average_video_play_p50, video_views_p25, video_views_p50, video_views_p75, video_views_p100, video_duration, reach, frequency, gross_impressions, profile_visits, profile_visits_rate, likes, comments, shares, follows, anchor_clicks, anchor_click_rate, duet_clicks, music_clicks, stitch_clicks, hat_clicks, engaged_view, engaged_view_15s, engaged_view_through_rate, engaged_view_through_rate_15s, cost_per_engaged_view, cost_per_engaged_view_15s, vta_conversion, vta_cost_per_conversion, cta_conversion, cta_cost_per_conversion, ix_page_viewrate, ix_page_duration_avg, ix_page_viewpercent_avg, elton_created_at

GMV Max (TikTok Ads)​

Report type GMV Max lấy báo cáo chiến dịch GMV Max của các TikTok Shop gắn với tài khoản quảng cáo. Cần chọn thêm:

  • GMV Max report: bắt buộc. Một hoặc nhiều báo cáo (mỗi báo cáo là một bảng):
    • All GMV Max Campaigns Overview: tổng của mọi chiến dịch GMV Max theo store và ngày.
    • Product GMV Max - Campaign level: từng chiến dịch Product GMV Max theo ngày.
    • Product GMV Max - Product level: từng sản phẩm (item_group_id) trong từng chiến dịch Product GMV Max theo ngày.
    • Product GMV Max - Creative level: từng creative (item_id) của từng sản phẩm trong từng chiến dịch theo ngày.
    • Live GMV Max - Campaign level: từng chiến dịch Live GMV Max theo ngày.
    • Live GMV Max - Livestream level: từng phiên livestream (room_id) trong từng chiến dịch Live GMV Max theo ngày.
  • GMV Max stores: bắt buộc. Các store (TikTok Shop) của các tài khoản đã chọn, dạng <tên store> (Advertiser ID: <id>). Store đã chọn nhưng không còn trong danh sách hiện cảnh báo Invalid GMV Max stores detected due to store removal or inactive! và nút Remove invalid GMV Max stores. Khi chạy, Elton bỏ qua (không báo lỗi) store không còn hoạt động (ACTIVE) hoặc không dùng được GMV Max. Nếu không còn store hợp lệ nào, lần chạy không lấy gì.

Với Elton app, form ghi rõ giới hạn của TikTok: báo cáo GMV Max chỉ lấy được tối đa 365 ngày gần nhất; Product GMV Max - Product level, Product GMV Max - Creative level, Live GMV Max - Livestream level chỉ lấy được 30 ngày gần nhất. Elton luôn lấy lại 3 ngày mỗi lần chạy. Hạn mức gọi API của Elton app dùng chung cho mọi khách hàng, nên báo cáo GMV Max có thể chạy chậm hơn khi nhiều connection chạy cùng lúc. Với Custom app, Elton theo First run loads from và Later runs rescan, không giới hạn số ngày.

Báo cáo Product level, Creative level và Livestream level được lấy theo từng chiến dịch: Elton tìm các chiến dịch (và sản phẩm, với Creative level) có số liệu trong khoảng lấy, rồi gọi báo cáo cho từng chiến dịch.

Mọi bảng GMV Max có account_id, account_name (tài khoản quảng cáo), store_id, store_name (store) và stat_time_day (ngày). Các cột tiền là số thực, theo tiền tệ của tài khoản quảng cáo.

CộtÝ nghĩa
cost, net_costChi phí, chi phí thuần
orders, cost_per_orderSố đơn, chi phí mỗi đơn
gross_revenue, roiDoanh thu gộp, ROI
target_roi_budget, max_delivery_budget, roas_bid, bid_typeNgân sách và cách đặt giá thầu của chiến dịch
live_views, metric_10_second_live_views, live_followsLượt xem LIVE, lượt xem trên 10 giây, lượt theo dõi từ LIVE
product_impressions, product_clicks, product_click_rate, ad_video_view_rate_2s…Số liệu creative (bảng Creative level)

Tất cả cột của tiktok_ads_gmv_max_campaign_overview_report: account_id, account_name, store_id, store_name, stat_time_day, cost, orders, cost_per_order, gross_revenue, roi, net_cost, elton_created_at

Tất cả cột của tiktok_ads_gmv_max_product_campaign_level_report: account_id, account_name, store_id, store_name, campaign_id, stat_time_day, operation_status, campaign_name, schedule_type, schedule_start_time, schedule_end_time, bid_type, target_roi_budget, max_delivery_budget, roas_bid, cost, net_cost, orders, cost_per_order, gross_revenue, roi, elton_created_at

Tất cả cột của tiktok_ads_gmv_max_product_product_level_report: account_id, account_name, store_id, store_name, campaign_id, campaign_name, item_group_id, stat_time_day, product_name, product_image_url, product_status, bid_type, orders, gross_revenue, cost, cost_per_order, roi, elton_created_at

Tất cả cột của tiktok_ads_gmv_max_product_creative_level_report: account_id, account_name, store_id, store_name, campaign_id, campaign_name, item_group_id, stat_time_day, creative_delivery_status, item_id, title, tt_account_name, tt_account_profile_image_url, tt_account_authorization_type, shop_content_type, orders, gross_revenue, product_impressions, product_clicks, product_click_rate, ad_click_rate, ad_conversion_rate, ad_video_view_rate_2s, ad_video_view_rate_6s, ad_video_view_rate_p25, ad_video_view_rate_p50, ad_video_view_rate_p75, ad_video_view_rate_p100, cost, cost_per_order, elton_created_at

Tất cả cột của tiktok_ads_gmv_max_live_campaign_report: account_id, account_name, store_id, store_name, campaign_id, stat_time_day, campaign_name, operation_status, tt_account_name, tt_account_profile_image_url, identity_id, bid_type, schedule_type, schedule_start_time, schedule_end_time, target_roi_budget, max_delivery_budget, roas_bid, cost, net_cost, orders, cost_per_order, gross_revenue, roi, live_views, cost_per_live_view, metric_10_second_live_views, cost_per_10_second_live_view, live_follows, elton_created_at

Tất cả cột của tiktok_ads_gmv_max_live_livestream_report: account_id, account_name, store_id, store_name, campaign_id, campaign_name, room_id, stat_time_day, live_name, live_status, live_launched_time, live_duration, cost, net_cost, orders, cost_per_order, gross_revenue, roi, live_views, cost_per_live_view, metric_10_second_live_views, cost_per_10_second_live_view, live_follows, elton_created_at

store_name lấy từ tên store lúc bạn chọn ở GMV Max stores; tên store có dấu - bị cắt tại dấu - đầu tiên.

Business Center Invoice (TikTok Ads)​

Service type = Business Center, loại Invoice. Hoá đơn của từng Business Center đã chọn, gồm hoá đơn loại RECON, CREDIT và AUTO_PAY. Elton lấy theo năm dương lịch: lần chạy đầu từ năm ở Load data since đến năm nay; các lần chạy sau lấy lại năm trước và năm nay.

CộtÝ nghĩa
business_center_id, business_center_name, business_center_type, business_center_status, business_center_currency, business_center_timezone, business_center_company, business_center_registered_areaBusiness Center của hoá đơn
invoice_id, invoice_title, invoice_type, serial_numberHoá đơn
status, pay_status, overdue_statusTrạng thái hoá đơn, thanh toán, quá hạn
send_date, due_dateNgày gửi, ngày đến hạn
amount, amount_excluding_tax, total_tax_amount, unpaid_amount, currency_codeSố tiền, trước thuế, thuế, còn nợ, tiền tệ
tax_type1, tax_rate1, tax_amount1, tax_type2, tax_rate2, tax_amount2Chi tiết thuế
account_name, address, country_code, billing_group_idBên nhận hoá đơn
positive_invoice_ids, negative_invoice_idsHoá đơn liên quan (điều chỉnh tăng, giảm)

Tất cả cột của tiktok_ads_business_center_invoice: business_center_id, business_center_name, business_center_company, business_center_registered_area, business_center_timezone, business_center_status, business_center_currency, business_center_type, invoice_id, invoice_title, invoice_type, subject_id, address, account_name, status, currency_code, serial_number, pay_status, due_date, send_date, billing_group_id, country_code, overdue_status, unpaid_amount, amount_excluding_tax, tax_id1, tax_type1, tax_rate1, tax_amount1, tax_id2, tax_type2, tax_amount2, tax_rate2, amount, total_tax_amount, emails, entity_serials, positive_invoice_ids, negative_invoice_ids, elton_created_at

4. Quan hệ giữa các bảng TikTok Ads​

Cấu trúc quảng cáo TikTok: một tài khoản quảng cáo (advertiser) có nhiều campaign, một campaign có nhiều ad group, một ad group có nhiều ad.

BảngNối với bảngĐiều kiện nốiQuan hệ
<tên bảng> (Data level AUCTION_CAMPAIGN, có dimension campaign_id)<tên bảng>_campaignCAST(account_id AS STRING) = account_id và CAST(campaign_id AS STRING) = campaign_idnhiều dòng báo cáo – 1 campaign
<tên bảng> (Data level AUCTION_ADGROUP, có dimension adgroup_id)<tên bảng>_adgroupCAST(adgroup_id AS STRING) = adgroup_idnhiều dòng báo cáo – 1 ad group
<tên bảng> (Data level AUCTION_AD, có dimension ad_id)<tên bảng>_adCAST(ad_id AS STRING) = ad_idnhiều dòng báo cáo – 1 ad
<tên bảng>_ad<tên bảng>_adgroup (của connection khác)adgroup_id = adgroup_idnhiều ad – 1 ad group
<tên bảng>_adgroup<tên bảng>_campaign (của connection khác)campaign_id = campaign_idnhiều ad group – 1 campaign
Mọi bảng có account_idtiktok_ads_account_infoaccount_id = advertiser_id (ép kiểu khi một bên là chuỗi)nhiều dòng – 1 tài khoản
<tên bảng>_adtiktok_ads_creative_basic_report, tiktok_ads_creative_video_insights_reportvideo_id = video_id1 video – nhiều ad
tiktok_ads_gmv_max_campaign_overview_reporttiktok_ads_gmv_max_product_campaign_level_report, tiktok_ads_gmv_max_live_campaign_reportaccount_id, store_id, stat_time_day1 store-ngày – nhiều chiến dịch
tiktok_ads_gmv_max_product_campaign_level_reporttiktok_ads_gmv_max_product_product_level_reportcampaign_id, stat_time_day1 chiến dịch-ngày – nhiều sản phẩm
tiktok_ads_gmv_max_product_product_level_reporttiktok_ads_gmv_max_product_creative_level_reportcampaign_id, item_group_id, stat_time_day1 sản phẩm-ngày – nhiều creative
tiktok_ads_gmv_max_live_campaign_reporttiktok_ads_gmv_max_live_livestream_reportcampaign_id, stat_time_day1 chiến dịch-ngày – nhiều phiên livestream

Lưu ý khi nối:

  • Ở bảng báo cáo <tên bảng>, account_id và các mã như campaign_id thường là số nguyên (INTEGER); ở bảng danh sách <tên bảng>_campaign, _adgroup, _ad chúng là chuỗi (STRING). Hãy CAST khi nối. Ở các bảng GMV Max, account_id, store_id, campaign_id, item_group_id, item_id, room_id là số nguyên; ở tiktok_ads_account_info, advertiser_id là số nguyên; ở hai bảng Creative, account_id và material_id là số nguyên còn video_id là chuỗi.
  • Mỗi connection Basic/Audience/Playable Material/Catalog chỉ tạo một bảng danh sách theo Data level. Để nối ad → ad group → campaign, cần các connection có Data level tương ứng.
  • Bảng báo cáo chỉ có tên campaign/ad group/ad khi bạn nối với bảng danh sách.

Ví dụ trên BigQuery, chi phí theo ngày và campaign, kèm tên campaign (connection Data level AUCTION_CAMPAIGN, Dimensions stat_time_day, campaign_id, bảng tiktok_ads_1a2b3c4d):

SELECT DATE(r.stat_time_day) AS day,
c.campaign_name,
SUM(r.spend) AS spend,
SUM(r.clicks) AS clicks
FROM `dataset.tiktok_ads_1a2b3c4d` r
LEFT JOIN `dataset.tiktok_ads_1a2b3c4d_campaign` c
ON c.account_id = CAST(r.account_id AS STRING)
AND c.campaign_id = CAST(r.campaign_id AS STRING)
GROUP BY day, c.campaign_name
ORDER BY day, spend DESC;

5. Lỗi thường gặp (TikTok Ads)​

LỗiNguyên nhân và cách xử lý
40001: <thông báo> hoặc thông báo có does not grant youTài khoản đã trao quyền không có quyền vào tài khoản quảng cáo, hoặc không có quyền cho loại báo cáo này. Elton không thử lại. Kiểm tra quyền trên TikTok, bấm Re-authorize, hoặc bỏ tài khoản đó khỏi Select Ads accounts.
40100: <thông báo>TikTok giới hạn số lần gọi API. Elton tự chờ và thử lại tối đa khoảng 6 phút. Nếu thông báo nói hết hạn mức trong ngày (daily, per day, QPD), Elton dừng ngay: hạn mức đặt lại lúc 00:00 UTC, chạy lại sau thời điểm đó. Với GMV Max trên Elton app, hạn mức dùng chung, hãy giảm số connection chạy cùng lúc.
Thông báo có invalid metric fieldsCó metric trong Metrics không hợp lệ với Report type hoặc Data level đã chọn. Xem link TikTok Ads Document cạnh ô Metrics, sửa rồi chạy lại.
<mã>: <thông báo> khácTikTok trả lỗi; Elton đã thử lại 5 lần (cách 15 giây, GMV Max 60–70 giây). Chạy lại connection sau ít phút. Nếu thông báo nói về access token hoặc quyền, bấm Re-authorize.
<mã HTTP>: <nội dung>TikTok trả lỗi HTTP. Chạy lại sau ít phút; nếu là 401, bấm Re-authorize.
No data to load found! Please select data to load in Connection configuration!Connection thiếu cấu hình: Business Center chưa chọn loại dữ liệu, hoặc GMV Max chưa chọn GMV Max report. Sửa connection.
Please select business center!Connection Business Center chưa chọn Business Center nào ở Select 1 or many business centers.
Unknown creative report: <tên>Report type Creative nhưng chưa chọn Creative report type.
Invalid accounts detected due to account removal or revoked permissions!… (trên form connection)Một số tài khoản đã chọn không còn trong danh sách được trao quyền. Bấm Remove invalid accounts, hoặc cấp lại quyền trên TikTok rồi Re-authorize. Xem Chọn tài khoản.
Invalid GMV Max stores detected due to store removal or inactive! (trên form connection)Store đã chọn không còn hoạt động hoặc không còn gắn với tài khoản. Bấm Remove invalid GMV Max stores.
Ô Select Ads accounts trốngSource chưa được trao quyền, tài khoản trao quyền không có tài khoản quảng cáo nào, hoặc ad block chặn việc tải danh sách. Tắt ad block, kiểm tra Advertisers available to connections ở trang source.
Không chọn được Business CenterBusiness Center loại NORMAL không lấy được hoá đơn nên bị khoá trong danh sách.
Bảng GMV Max trống dù đã chạy thành côngMọi store đã chọn đều không còn ACTIVE hoặc không dùng được GMV Max, nên Elton bỏ qua. Kiểm tra store trên TikTok.
Thiếu số liệu GMV Max hoặc Creative cũVới Elton app, GMV Max lấy tối đa 365 ngày (30 ngày với Product level, Creative level, Livestream level), Creative tối đa 180 ngày. Dùng Custom app nếu cần lấy xa hơn.
Số liệu những ngày gần đây thay đổi sau khi đã lấyTikTok còn cập nhật số liệu (chuyển đổi đến muộn). Tăng Later runs rescan (với Creative/GMV Max trên Elton app, Elton luôn lấy lại 3 ngày).

Cách tính Billable Pipeline​

Cách tính phí theo số pipeline của từng loại source xem ở đây. Riêng connection TikTok Ads với Report type GMV Max, số pipeline tính phí bằng số báo cáo đã chọn ở GMV Max report.

Template báo cáo​

Hướng dẫn tạo báo cáo từ mẫu có sẵn của Elton trên Looker Studio xem ở đây.