# NOT RUN {
# 1.Get a static message on advertising
# campaigns in the context of days
## 1.1. We get a list of advertising campaigns
camp <- vkGetAdCampaigns(account_id = 1, access_token = my_tok$access_token)
## 1.2. We get statistics on advertising campaigns
vk_stat_by_campaign <- vkGetAdStatistics(account_id = 1,
ids_type = "campaign",
ids = camp$id ,
period = "day",
date_from = "2010-01-01",
date_to = "2017-09-10")
# 2.Receive a static message on the ads in the context of months
## 2.1. We get a list of advertising campaigns
ads <- vkGetAds(account_id = account_id)
## 2.2. Get ad statistics
vk_stat_by_ads <- vkGetAdStatistics(account_id = 1,
ids_type = "ad",
ids = ads$id ,
period = "month",
date_from = "2010-01-01",
date_to = "2017-09-10")
# 3.Receive the general static of the advertising cabinet, in this example
# it is assumed that the id of the advertising cabinet is 1
vk_stat_by_account <- vkGetAdStatistics(account_id = 1,
ids_type = "office",
ids = 1,
period = "overall",
date_from = "2010-01-01",
date_to = "2017-09-10")
# }
Run the code above in your browser using DataLab