# NOT RUN {
# 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_gender_age_stat_day <- vkGetAdGenderAgeStats(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_gender_age_stat_month <- vkGetAdGenderAgeStats(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_gender_age_stat_total <- vkGetAdGenderAgeStats(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