rmytarget-package {rmytarget}R Documentation

Paxkage for load data from 'MyTarget' API.

Description

Load data from API 'MyTarget' into R, by agancy clients and campaigns

Details

The DESCRIPTION file:

Package: rmytarget
Type: Package
Title: Load Data from 'MyTarget API v2 and v3'
Version: 2.4.0
Date: 2021-10-20
Authors@R: c(person(given = "Alexey", family = "Seleznev", role = c("aut", "cre"), email = "selesnow@gmail.com", comment = c(ORCID = "0000-0003-0410-7385")), person(given = "Netpeak", role = c("cph")))
Maintainer: Alexey Seleznev <selesnow@gmail.com>
Description: Allows work with 'MyTarget Statistics API v2' <https://target.my.com/adv/api-marketing/doc/stat-v2> and 'MyTarget Statistics API v3' <https://target.my.com/adv/api-marketing/doc/stat-v2#statisticsv3> load data by ads, campaigns, agency clients and statistic from your ads account.
URL: https://selesnow.github.io/rmytarget/
Imports: httr, dplyr, lubridate, stringr, purrr, tidyr
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
Depends: R (>= 3.5.0)
License: MIT + file LICENSE
Language: ru
Encoding: UTF-8
RoxygenNote: 7.1.2
Author: Alexey Seleznev [aut, cre] (<https://orcid.org/0000-0003-0410-7385>), Netpeak [cph]

Index of help topics:

myTarAuth               Authentication in 'MyTarget API'
myTarGetAdList          Get ads list from 'MyTarget'
myTarGetCampaignList    Get campaign list from 'MyTarget'
myTarGetClientList      Get Agency Clients from 'MyTarget'
myTarGetFastStats       Returns Basic Statistics in Real Time
myTarGetGoalList        Get goal list from 'MyTarget'
myTarGetGoalsStats      Get Goal Statistics from 'MyTarget'
myTarGetInAppStats      Returns statistics on mobile app events
                        attributed with advertising impressions
                        myTarget by campaigns and banners
myTarGetOfflineConversionsStats
                        Returns Statistics on Events Attributed With
                        'myTarget' Ad Impressions From Offline
                        Conversion Lists for Campaigns
myTarGetStats           Get stat by clients, campaigns or banners from
                        'API MyTarget'
myTarRefreshToken       Refresh Access Token
myTarSetLogin           Set MyTarget login
myTarSetTokenPath       Set path to auth cache
rmytarget-package       Paxkage for load data from 'MyTarget' API.

Author(s)

Alexey Seleznev

References

1. MyTarget API documents 2. MyTarget API statistic methods 3. Authorization

Examples

## Not run: 
# Get objects
## Get ads
Ads <- myTarGetAdList(login = "my_test_client")

## Get campaigns
Campaigns <- myTarGetCampaignList(login = "my_test_client")

# Get statistic
# base metrics by campaigns
base_data <- myTarGetTotalData(date_from   = Sys.Date() - 7,
                               date_to     = Sys.Date(),
                               object_type = "campaigns",
                               object_id = Campaigns$id,
                               metrics = "base",
                               stat_type = "day",
                               login = "my_test_client", 
                               token_path = "mytarget_token")

# all metrics by campaigns
all_data <- myTarGetTotalData(date_from   = Sys.Date() - 7,
                              date_to     = Sys.Date(),
                              object_type = "campaigns",
                              object_id = Campaigns$id,
                              metrics = "all",
                              stat_type = "day",
                              login = "my_test_client", 
                              token_path = "mytarget_token")

# custom set of metric by campaigns
custom_data <- myTarGetTotalData(date_from   = Sys.Date() - 7,
                                 date_to     = Sys.Date(),
                                 object_type = "campaigns",
                                 object_id = Campaigns$id,
                                 metrics = c("base", "tps", "viral"),
                                 stat_type = "day",
                                 login = "my_test_client", 
                                 token_path = "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 = "my_test_client", 
                                token_path = "mytarget_token")

## End(Not run)

[Package rmytarget version 2.4.0 Index]