# NOT RUN {
## auth
my_tok <- vkAuth(app_id = 1, app_secret = "H2Pk8htyFD8024mZaPHm")
# 1.Get a static message on audience coverage by sex,
# advertising campaigns in the context of days
## 1.1. We get a list of advertising campaigns
camp <- vkGetAdCampaigns(account_id = 1)
## 1.2. We get statistics on advertising campaigns
vk_ad_age_stat_day <- vkGetAdAgeStats(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_ad_age_stat_month <- vkGetAdAgeStats(account_id = 1,
ids_type = "ad",
ids = ads$id ,
period = "month",
date_from = "2010-01-01",
date_to = "2017-09-10")
# 3.Get a static message on reaching the audience for advertising campaigns
# without a temporary breakdown
## 3.1. We get a list of advertising campaigns
camp <- vkGetAdCampaigns(account_id = 1)
## 3.2. We get statistics on advertising campaigns
vk_ad_age_stat_total <- vkGetAdAgeStats(account_id = 1,
ids_type = "campaign",
ids = camp$id ,
period = "overall",
date_from = "2010-01-01",
date_to = "2017-09-10")
# }
Run the code above in your browser using DataLab