# NOT RUN {
# base metrics by campaigns
base_data <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "campaigns",
metrics = "base",
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# all metrics by campaigns
all_data <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "campaigns",
metrics = "all",
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# custom set of metric by campaigns
custom_data <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "campaigns",
metrics = c("base", "tps", "viral"),
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# if have note objects id, base metrics by ads
base_data2 <- myTarGetStats(date_from = as.Date("2013-01-01"),
date_to = Sys.Date(),
object_type = "banners",
metrics = "base",
stat_type = "day",
login = "client_login",
token_path = "D:\\mytarget_token")
# get all stats group by clients, only for agency account
client_stat <- myTarGetStats(date_from = Sys.Date() - 7,
date_to = Sys.Date(),
object_type = "users",
metrics = "all",
login = "agency_login")
# }
Run the code above in your browser using DataLab