Learn R Programming

rtiktokads (version 0.3.4)

tik_get_report: Get Marketing Report

Description

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.

Usage

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
)

Value

tibble with report data

Arguments

advertiser_id

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.

advertiser_ids

A list of advertiser IDs.

bc_id

ID of a Business Center that you have access to.

service_type

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

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.

data_level

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.

dimensions

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.

metrics

Metrics to query. Different report types support different metrics. For supported metrics for each report type, see the corresponding articles under Report types.

enable_total_metrics

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.

start_date

Query start date (closed interval) in the format of YYYY-MM-DD. The date is based on the ad account time zone.

end_date

Query end date (closed interval) in the format of YYYY-MM-DD. The date is based on the ad account time zone.

query_lifetime

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.

multi_adv_report_in_utc_time

Whether to set the returned metrics in the local timezone of each respective advertiser.

order_field

Sorting field.

order_type

Sorting order. ASC or DESC.

Details

To take more details see API documentation

Examples

Run this code
if (FALSE) {
report <- tik_get_report(advertiser_id = '7499750467069771792')
}

Run the code above in your browser using DataLab