Use this function to create a synchronous report task. This function can currently return the reporting data of up to 20,000 advertisements. If your number of advertisements exceeds 20,000, please use campaign_ids / adgroup_ids / ad_ids as a filter to obtain the reporting data of all advertisements in batches. If you use campaign_ids / adgroup_ids / ad_ids as a filter, you can pass in up to 100 IDs at a time.
tik_get_report(
advertiser_id = NULL,
advertiser_ids = NULL,
bc_id = NULL,
service_type = NULL,
report_type = "BASIC",
data_level = "AUCTION_ADVERTISER",
dimensions = c("advertiser_id", "stat_time_day"),
metrics = "spend",
enable_total_metrics = FALSE,
start_date = Sys.Date() - 7,
end_date = Sys.Date() - 1,
query_lifetime = FALSE,
multi_adv_report_in_utc_time = FALSE,
order_field = NULL,
order_type = NULL
)tibble with report data
Advertiser ID. You need to pass in either advertiser_id/advertiser_ids or bc_id.
When report_type is set to BASIC or AUDIENCE, pass in advertiser_id or advertiser_ids. If you pass in both advertiser_id and advertiser_ids, advertiser_id will be ignored.
When report_type is set to PLAYABLE_MATERIAL, CATALOG, or TT_SHOP, pass in advertiser_id.
When report_type is set to BC, pass in bc_id.
A list of advertiser IDs.
ID of a Business Center that you have access to.
Ad service type. Not supported when report_type is BC.
AUCTION: auction ads, or both auction ads and reservation ads.
RESERVATION (deprecated) : reservation ads.
Report type:
BASIC: basic report.
AUDIENCE: audience report.
PLAYABLE_MATERIAL: playable ads report.
CATALOG: DSA report.
BC: Business Center report.
TT_SHOP: GMV max ads report.
The data level that you'd like to query in reports.
AUCTION_AD: auction ads or both auction ads and reservation ads, ad level.
AUCTION_ADGROUP: auction ads or both auction ads and reservation ads, ad group level.
AUCTION_CAMPAIGN: auction ads or both auction ads and reservation ads, campaign level.
AUCTION_ADVERTISER: auction ads or both auction ads and reservation ads, advertiser level.
Grouping conditions. For example: ("campaign_id", "stat_time_day") indicates that both campaign_id and stat_time_day (days) are grouped. Different report types support different dimensions.
Supported dimensions in basic reports
Supported dimensions in audience reports
Supported dimensions in playable ad reports
Supported dimensions in DSA reports
Supported dimensions in Business Center reports
Supported dimensions in GMV max ads reports
Metrics to query. Different report types support different metrics. For supported metrics for each report type, see the corresponding articles under Report types.
Whether to enable the total added-up data for your requested metrics. When enable_total_metrics is enabled, we will provide the aggregate data for all pages as you query different pages. Under this condition, you only need to specify this field when requesting data for the first page.
Query start date (closed interval) in the format of YYYY-MM-DD. The date is based on the ad account time zone.
Query end date (closed interval) in the format of YYYY-MM-DD. The date is based on the ad account time zone.
Whether to request the lifetime metrics. Default value: False. If query_lifetime = True, the start_date and end_date parameters will be ignored. The lifetime metric name is the same as the normal one.
Whether to set the returned metrics in the local timezone of each respective advertiser.
Sorting field.
Sorting order. ASC or DESC.
To take more details see API documentation
if (FALSE) {
report <- tik_get_report(advertiser_id = '7499750467069771792')
}
Run the code above in your browser using DataLab