Type: | Package |
Title: | Load Data From 'Yandex Direct' |
Version: | 3.6.2 |
Description: | Load data from 'Yandex Direct' API V5 https://yandex.ru/dev/direct/doc/dg/concepts/about-docpage into R. Provide function for load lists of campaings, ads, keywords and other objects from 'Yandex Direct' account. Also you can load statistic from API 'Reports Service' https://yandex.ru/dev/direct/doc/reports/reports-docpage. And allows keyword bids management. |
License: | GPL-2 |
Author: | Alexey Seleznev |
Maintainer: | Alexey Seleznev <selesnow@gmail.com> |
Depends: | R (≥ 3.5.0) |
BugReports: | https://github.com/selesnow/ryandexdirect/issues |
URL: | https://selesnow.github.io/ryandexdirect/, https://t.me/R4marketing, https://www.youtube.com/playlist?list=PLD2LDq8edf4oUo0L9Kw77ZXf0KcV1hu67 |
Imports: | utils, httr, bitops, jsonlite, xml2, data.table, readr, magrittr, dplyr, tidyr (≥ 1.0.0), purrr, stringr |
Suggests: | knitr, rmarkdown, kableExtra, googleAnalyticsR |
Encoding: | UTF-8 |
Language: | ru |
VignetteBuilder: | knitr |
NeedsCompilation: | no |
Packaged: | 2023-03-17 11:49:08 UTC; SAMSUNG |
Repository: | CRAN |
Date/Publication: | 2023-03-17 12:30:02 UTC |
Load Data From 'Yandex Direct'
Description
Load data from 'Yandex Direct' API V5 <https://yandex.ru/dev/direct/doc/dg/concepts/about-docpage> into R. Provide function for load lists of campaings, ads, keywords and other objects from 'Yandex Direct' account. Also you can load statistic from API 'Reports Service' <https://yandex.ru/dev/direct/doc/reports/reports-docpage>. And allows keyword bids management.
Details
The DESCRIPTION file:
Package: | ryandexdirect |
Type: | Package |
Title: | Load Data From 'Yandex Direct' |
Version: | 3.6.2 |
Description: | Load data from 'Yandex Direct' API V5 <https://yandex.ru/dev/direct/doc/dg/concepts/about-docpage> into R. Provide function for load lists of campaings, ads, keywords and other objects from 'Yandex Direct' account. Also you can load statistic from API 'Reports Service' <https://yandex.ru/dev/direct/doc/reports/reports-docpage>. And allows keyword bids management. |
License: | GPL-2 |
Authors@R: | c(person(given = "Alexey", family = "Seleznev", role = c("aut", "cre"), email = "selesnow@gmail.com", comment = c(ORCID = "0000-0003-0410-7385"))) |
Author: | Alexey Seleznev [aut, cre] (<https://orcid.org/0000-0003-0410-7385>) |
Maintainer: | Alexey Seleznev <selesnow@gmail.com> |
Depends: | R (>= 3.5.0) |
BugReports: | https://github.com/selesnow/ryandexdirect/issues |
URL: | https://selesnow.github.io/ryandexdirect/, https://t.me/R4marketing, https://www.youtube.com/playlist?list=PLD2LDq8edf4oUo0L9Kw77ZXf0KcV1hu67 |
Imports: | utils, httr, bitops, jsonlite, xml2, data.table, readr, magrittr, dplyr, tidyr (>= 1.0.0), purrr, stringr |
Suggests: | knitr, rmarkdown, kableExtra, googleAnalyticsR |
Encoding: | UTF-8 |
Language: | ru |
VignetteBuilder: | knitr |
Index of help topics:
ryandexdirect-deprecated Deprecated functions in ryandexdirect ryandexdirect-package Load Data From 'Yandex Direct' yadirAuth Authentication in 'Yandex Direct' API yadirCurrencyRates Get currencies yadirGetAdGroups Get AdGroups List yadirGetAds Get Ads List From 'Yandex Direct' account yadirGetBalance Get 'Yandex Direct' account balance yadirGetCampaign Get Campaigns List yadirGetClientList Get Client List From Agency Account yadirGetClientParam Get params list from 'Yandex Direct' agency clients yadirGetCostData Loading Cost Data for Upload to Google Analytics yadirGetDictionary Get Dictionary from 'Yandex Direct' yadirGetForecast Get Forecast yadirGetKeyWords Get Keywords yadirGetKeyWordsBids Get KeyWords Bids yadirGetLogins Get Login List or Set Login yadirGetReport Get Report From 'Yandex Direct Report Service' yadirGetSiteLinks Get Fast Links yadirGetToken Auth in 'Yandex Direct' API yadirGetWordStatReport Get WordStat Report yadirSetAgencyAccount Set Agency Account yadirSetAutoKeyWordsBids Auto Set KeyWords Bids yadirSetKeyWordsBids Set KeyWords Bids yadirSetLogin Set Login yadirStartAds Start Ads yadirStartCampaigns Start Campaigns yadirStartKeyWords Resume KeyWords yadirStopAds Suspend impressions by Ads yadirStopCampaigns Suspend impressions by Campaigns yadirStopKeyWords Suspend impressions by KeyWords
Author(s)
Alexey Seleznev [aut, cre] (<https://orcid.org/0000-0003-0410-7385>)
Maintainer: Alexey Seleznev <selesnow@gmail.com>
Deprecated functions in ryandexdirect
Description
List of depricated functions and their new versions.
Deprecated fnctions
Next function is deprecated:
yadirGetCampaignList()
use
yadirGetCampaign()
, from september 2019- yadirGetCampaignListOld()
use
yadirGetCampaign()
, from april 2019- yadirGetLogsData()
use
rym_get_logs()
, from april 2019- yadirGetMetrikaGAData()
use
rym_get_ga()
, from april 2019- yadirGetSummaryStat()
use
yadirGetReport()
, from march 2017
Authentication in 'Yandex Direct' API
Description
Get API Token for 'Yandex Direct' account
Usage
yadirAuth(Login = getOption("ryandexdirect.user"),
NewUser = FALSE,
TokenPath = yadirTokenPath())
Arguments
Login |
character, your login at Yandex, require |
NewUser |
logical, use TRUE if you want login into new account |
TokenPath |
Path to directory where you save credential data |
Value
R object with api token
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
library(ryandexdirect)
yadirAuth(Login = "login", NewUser = TRUE,
TokenPath = tempdir())
## End(Not run)
Get currencies
Description
Exchange rates, currency parameters and restrictions.
Usage
yadirCurrencyRates(
Login = getOption("ryandexdirect.user"),
AgencyAccount = getOption("ryandexdirect.agency_account"),
Token = NULL,
TokenPath = yadirTokenPath())
Arguments
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Token |
character or list object, your Yandex API Token, you can get this by function yadirGetToken or yadirAuth |
Value
data frame with campaings names and parameters
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# from storage tokrn
library(ryandexdirect)
cur <- yadirCurrencyRates(Login = "login" ,
TokenPath = tempdir())
# from auth object
aut <- yadirAuth(Login = "login", NewUser = TRUE,
TokenPath = tempdir())
cur2 <- yadirCurrencyRates(Login = "login" ,
Token = aut)
## End(Not run)
Get AdGroups List
Description
Returns parameters of adgroups that meet specified criteria.
Usage
yadirGetAdGroups(CampaignIds = NULL,
Ids = NA,
Types = c("TEXT_AD_GROUP",
"MOBILE_APP_AD_GROUP",
"DYNAMIC_TEXT_AD_GROUP",
"CPM_BANNER_AD_GROUP",
"CPM_VIDEO_AD_GROUP",
"SMART_AD_GROUP"),
Statuses = c("ACCEPTED",
"DRAFT",
"MODERATION",
"PREACCEPTED",
"REJECTED"),
Login = getOption("ryandexdirect.user"),
AgencyAccount = getOption("ryandexdirect.agency_account"),
Token = NULL,
TokenPath = yadirTokenPath())
Arguments
CampaignIds |
character vector with yandex direct campaign ID, require |
Ids |
character vector with yandex direct adgroup ID |
Types |
character vector with adgroup types states |
Statuses |
character vector with adgroup types statuses |
Login |
character, your login at Yandex, require |
Token |
character, your Yandex Direct API Token, require |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Value
data frame with adgroups names and parameters
Author(s)
Alexey Seleznev
Examples
## Not run:
#For get adgroups data frame
# Get data from clients account
my_ad_group <- yadirGetAdGroups(Login = "login")
# Get data from agency account
### !!!Please choose another TokenPath to save the Login permanently.
my_ad_group <- yadirGetAdGroups(Login = "client_login",
AgencyAccount = "agency_login",
TokenPath = tempdir())
## End(Not run)
Get Ads List From 'Yandex Direct' account
Description
Returns the parameters of ads that match the specified criteria.
Usage
yadirGetAds(CampaignIds = NULL,
AdGroupIds = NA,
Ids = NA,
Types = c("TEXT_AD", "MOBILE_APP_AD", "DYNAMIC_TEXT_AD",
"IMAGE_AD", "CPC_VIDEO_AD", "CPM_BANNER_AD",
"CPM_VIDEO_AD", "SMART_AD"),
States = c("OFF","ON","SUSPENDED","OFF_BY_MONITORING","ARCHIVED"),
Login = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
CampaignIds |
character vector with yandex direct campaign ID, require |
AdGroupIds |
character vector with yandex direct adgroup ID |
Ids |
character vector with yandex direct ad ID |
Types |
character vector, types of ads: TEXT_AD, MOBILE_APP_AD, DYNAMIC_TEXT_AD, IMAGE_AD, CPC_VIDEO_AD, CPM_BANNER_AD, CPM_VIDEO_AD, SMART_AD |
States |
character vector with ad states |
Login |
character, your login at Yandex, require |
Token |
character, your Yandex Direct API Token, require |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Value
Data Frame
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
#For get ads data frame
# Get ads from client account
aut <- yadirAuth(Login = "login", NewUser = TRUE,
TokenPath = tempdir())
my_ads <- yadirGetAds(Login = "login",
Token = aut)
# Get data from agency account
aut <- yadirAuth(Login = "agency_login", NewUser = TRUE,
TokenPath = tempdir())
my_ads <- yadirGetAds(Login = "client_login",
AgencyAccount = "agency_login",
Token = aut)
## End(Not run)
Get 'Yandex Direct' account balance
Description
Returns settings for shared accounts.
Usage
yadirGetBalance(Logins = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Logins |
character vector, your logins at Yandex Direct, require |
Token |
character, your Yandex Direct API Token, require |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Value
Data frame
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
aut <- yadirAuth(Login = "login", NewUser = TRUE,
TokenPath = tempdir())
#For get accounts from client account use
my_balance <- yadirGetBalance(Logins = "login",
Token = aut)
#For get accounts from agancy account use
library(ryandexdirect)
aut <- yadirAuth(Login = "agency_login", NewUser = TRUE,
TokenPath = tempdir())
client <- yadirGetClientList(Token = aut)
client_balance <- yadirGetBalance(Logins = client$Login,
AgencyAccount = "agency_login",
Token = aut)
## End(Not run)
Get Campaigns List
Description
Returns the parameters of campaigns that meet the specified criteria.
Usage
yadirGetCampaignList(Logins = getOption("ryandexdirect.user"),
States = c("OFF", "ON", "SUSPENDED",
"ENDED", "CONVERTED", "ARCHIVED"), Types =
c("TEXT_CAMPAIGN", "MOBILE_APP_CAMPAIGN",
"DYNAMIC_TEXT_CAMPAIGN", "CPM_BANNER_CAMPAIGN"),
Statuses = c("ACCEPTED", "DRAFT", "MODERATION",
"REJECTED"), StatusesPayment = c("DISALLOWED",
"ALLOWED"), Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
yadirGetCampaign(Logins = getOption("ryandexdirect.user"),
States = c("OFF", "ON", "SUSPENDED",
"ENDED", "CONVERTED", "ARCHIVED"), Types =
c("TEXT_CAMPAIGN", "MOBILE_APP_CAMPAIGN", "DYNAMIC_TEXT_CAMPAIGN",
"CPM_BANNER_CAMPAIGN", "SMART_CAMPAIGN"),
Statuses = c("ACCEPTED", "DRAFT", "MODERATION",
"REJECTED"), StatusesPayment = c("DISALLOWED",
"ALLOWED"), Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Logins |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Token |
character or list object, your Yandex API Token, you can get this by function yadirGetToken or yadirAuth |
States |
character vector, filter by campaign states, for example c("OFF", "ON", "SUSPENDED", "ENDED", "CONVERTED", "ARCHIVED") |
Types |
character vector with campaign types, example c("TEXT_CAMPAIGN", "MOBILE_APP_CAMPAIGN", "DYNAMIC_TEXT_CAMPAIGN") |
Statuses |
character vector, filter campaign list by status, for example c("ACCEPTED", "DRAFT", "MODERATION", "REJECTED") |
StatusesPayment |
character vector, filter campaign list by payment status, for example c("DISALLOWED", "ALLOWED") |
Value
data frame with campaings names and parameters
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
#Get data from client accounts
my_ad_group <- yadirGetCampaign(Login = "login",
TokenPath = tempdir())
#Get data from agency account
# Auth
aut <- yadirAuth(Login = "agency_login",
NewUser = TRUE,
TokenPath = tempdir())
# Load Ad Group List
my_ad_group <- yadirGetCampaign(Login = "client_login",
Token = aut,
TokenPath = tempdir())
## End(Not run)
Get Client List From Agency Account
Description
Returns a list of advertisers - agency clients, their parameters and settings of the main representatives of the advertiser.
Usage
yadirGetClientList(
AgencyAccount = getOption("ryandexdirect.agency_account"),
Token = NULL,
TokenPath = yadirTokenPath())
Arguments
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Token |
character or list object, your Yandex API Token, you can get this by function yadirGetToken or yadirAuth |
Value
data frame with client list
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
my_client <- yadirGetClientList(AgencyAccount = "agency_login",
TokenPath = tempdir())
## End(Not run)
Get params list from 'Yandex Direct' agency clients
Description
Returns the parameters of the advertiser and the settings of the user - the representative of the advertiser or the parameters of the agency and the settings of the user - the representative of the agency.
Usage
yadirGetClientParam(Language = "ru",
Logins = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Logins |
Character vector of yandex logins |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Token |
character or list object, your Yandex API Token, you can get this by function yadirGetToken or yadirAuth |
Language |
Answer language one of en, ru, tr, uk |
Value
data frame with campaings names and parameters
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
#Get client param from agency account
client_param <- yadirGetClientParam(AgencyAccount = "agency_login",
TokenPath = tempdir())
## End(Not run)
Loading Cost Data for Upload to Google Analytics
Description
Get data on expenses, impressions and clicks on advertising campaigns, keywords and ads for further loading into 'Google Analytics' source.
Usage
yadirGetCostData(
DateFrom = Sys.Date() - 31,
DateTo = Sys.Date() - 1,
Source = 'yandex',
Medium = 'cpc',
IncludeVAT = "YES",
IncludeDiscount = "NO",
Login = getOption("ryandexdirect.user"),
AgencyAccount = getOption("ryandexdirect.agency_account"),
FetchBy = NULL,
Token = NULL,
TokenPath = yadirTokenPath())
Arguments
DateFrom |
If your select CUSTOM_DATE in DateRangeType you must enter start date in this argument in YYYY-MM-DD format else you can not used this argument |
DateTo |
If your select CUSTOM_DATE in DateRangeType you must enter end date in this argument in YYYY-MM-DD format else you can not used this argument |
Source |
Character, UTM source |
Medium |
Character, UTM medium |
IncludeVAT |
Include or exclude VAT, one of "NO" or "YES" |
IncludeDiscount |
Include or exclude Discount, one of "NO" or "YES" |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
FetchBy |
Split the query by date range. Allowed values: "DAY", "WEEK", "MONTH", "QUARTER", "YEAR". |
TokenPath |
Path to directory where you save credential data |
Token |
character or list object, your Yandex API Token, you can get this by function yadirGetToken or yadirAuth |
Value
Data frame with cost data
Author(s)
Alexey Seleznev
Examples
## Not run:
###
# Use googleAnalyticsR for upload data into Google Analytics
library(googleAnalyticsR)
# load cost data
cost_data <- yadirGetCostData(DateFrom = "2020-05-10",
DateTo = '2020-05-14')
# upload into GA source
ga_custom_upload_file(accountId = xxxx,
webPropertyId = "UA-xxxx-1",
customDataSourceId = 'abcdefg',
cost_data)
## End(Not run)
Get Dictionary from 'Yandex Direct'
Description
Returns reference data: regions, time zones, exchange rates, list of metro stations, restrictions on parameter values, external networks (SSP), Crypt segments for targeting by user profile, etc.
Usage
yadirGetDictionary(DictionaryName = "GeoRegions",
Language = "ru",
Login = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
DictionaryName |
character string with Dictionary name, one of Currencies, MetroStations, GeoRegions, TimeZones, Constants, AdCategories, OperationSystemVersions, ProductivityAssertions, SupplySidePlatforms, Interests |
Language |
Answer message lenguage, by default "ru", support one of en, ru, tr, uk |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Token |
character or list object, your Yandex API Token, you can get this by function yadirGetToken or yadirAuth |
Value
Data Frame
Author(s)
Alexey Seleznev
References
For more details go link
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
geo <- yadirGetDictionary(Login = "login",
DictionaryName = "GeoRegions",
TokenPath = tempdir())
## End(Not run)
Get Forecast
Description
Returns a forecast for cost, click and impression
Usage
yadirGetForecast(Phrases,
GeoID = 0,
Currency = "RUB",
AuctionBids = "No",
Login = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Phrases |
character vector of key phrases for which you want to get a forecast, require |
GeoID |
character vectora, an array of key phrases for which you want to obtain statistics on search queries |
Currency |
The currency in which click prices and total costs in the report should be expressed. Possible values: RUB, CHF, EUR, KZT, TRY, UAH, USD, BYN. |
AuctionBids |
Whether to display trading results in the report (Yes / No) |
Login |
integer, An array of region identifiers. Allows you to get statistics on search queries made only in the specified regions, see yadirGetDictionary |
Token |
character, your Yandex Direct API Token, require |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Value
Data Frame
Author(s)
Alexey Seleznev
Examples
## Not run:
# get forecast
forecast <- yadirGetForecast(c('buy smartphone -xiaomi',
'buy samsung'),
Login = "selesnow")
## End(Not run)
Get Keywords
Description
Returns the parameters of key phrases or autotargets that match the specified criteria: the values of the placeholder variables, status and status, statistics of impressions and clicks, rates and priorities.
Usage
yadirGetKeyWords(CampaignIds = NULL, AdGroupIds = NA, Ids = NA, States
= c("OFF", "ON", "SUSPENDED"), WithStats = TRUE,
Login = getOption("ryandexdirect.user"), Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
CampaignIds |
character vector with yandex direct campaign ID, require |
AdGroupIds |
character vector with yandex direct adgroup ID |
Ids |
character vector with yandex direct ad ID |
States |
character vector with ad states |
WithStats |
logical, if TRUE then load stat by impressions and click but load process will be long durations |
Login |
character, your login at Yandex, require |
Token |
character, your Yandex Direct API Token, require |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Value
data frame with campaings names and parameters
Author(s)
Alexey Seleznev
Examples
## Not run:
# get data from agency account
### Please choose another TokenPath to save the Login permanently.
my_keywords <- yadirGetKeyWords(Login = "client_login",
AgencyAccount = "agency_login",
TokenPath = tempdir())
## End(Not run)
Get KeyWords Bids
Description
Returns bids and priorities for key phrases and auto-targeting that meet specified criteria, as well as bidding data: bids and write-off prices for different traffic volumes on a search and bids to reach different audience shares in networks.
Usage
yadirGetKeyWordsBids(
KeywordIds = NULL,
AdGroupIds = NULL,
CampaignIds = NULL,
AuctionBids = c(NA,
"search",
"network"),
Login = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
KeywordIds |
Phrase ID. Specified if you want to update the bid for an individual phrase. |
AdGroupIds |
Ad Group ID. Specified if you need to update bids for all group phrases. |
CampaignIds |
Campaign ID. Specified if you need to update bids for all campaign phrases. |
AuctionBids |
Data on auctions, specify information about which auctions you are requesting. The values are: NA, "search", "network" |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Use AuctionBids = "search" when you need traffic volume, bid on the search corresponding to the specified amount of traffi and charged price corresponding to the specified amount of traffic. Use AuctionBids = "search" when you need get frequency of the show (audience share) in networks (specified in percent from 0 to 100) and network bid that matches the frequency shown.
Value
Data Frame with keyword bids and auction data
Author(s)
Alexey Seleznev
References
KeyWord Bids API documentation KeyWord Bids get method API documentation
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
## Only bids for keywords with ids 123, 234, 345
bids <- yadirGetKeyWordsBids(KeywordIds = c(123, 234, 345))
### Get bids with search auction data
search_bids <-
yadirGetKeyWordsBids(KeywordIds = c(123, 234, 345)
AuctionBids = "search")
### Get bids with network auction data
network_bids <-
yadirGetKeyWordsBids(KeywordIds = c(123, 234, 345)
AuctionBids = "network")
## End(Not run)
Get Login List or Set Login
Description
Get and set List of accessed yandex direct login from token path.
Usage
yadirGetLogins(TokenPath = yadirTokenPath(), SetLogin = TRUE)
Arguments
TokenPath |
Path to directory where you save credential data |
SetLogin |
Boolean, if TRUE you will choose default login |
Value
vector with logins
Author(s)
Alexey Seleznev
Examples
## Not run:
logins <- yadirGetLogins()
## End(Not run)
Get Report From 'Yandex Direct Report Service'
Description
The 'Service Report' is designed to get statistics on the advertiser's account. You must set period, choose report type and needed fields, and get statistic.
Usage
yadirGetReport(ReportType = "CUSTOM_REPORT", DateRangeType =
"CUSTOM_DATE", DateFrom = Sys.Date() - 31,
DateTo = Sys.Date() - 1,
FieldNames = c("CampaignName", "Impressions",
"Clicks", "Cost"), FilterList = NULL, Goals = NULL,
AttributionModels = NULL, IncludeVAT = "YES",
IncludeDiscount = "NO", Login = getOption("ryandexdirect.user"),
AgencyAccount = getOption("ryandexdirect.agency_account"),
FetchBy = NULL, Token = NULL, TokenPath = yadirTokenPath(),
SkipErrors = TRUE)
Arguments
ReportType |
Report level, one from ACCOUNT_PERFORMANCE_REPORT, CAMPAIGN_PERFORMANCE_REPORT, ADGROUP_PERFORMANCE_REPORT, AD_PERFORMANCE_REPORT, CRITERIA_PERFORMANCE_REPORT, CUSTOM_REPORT, SEARCH_QUERY_PERFORMANCE_REPORT. For detail go https://tech.yandex.ru/direct/doc/reports/type-docpage/ |
DateRangeType |
Reporting period, one from TODAY, YESTERDAY, LAST_3_DAYS, LAST_5_DAYS, LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS, LAST_90_DAYS, LAST_365_DAYS, THIS_WEEK_MON_TODAY ,THIS_WEEK_SUN_TODAY, LAST_WEEK, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT, THIS_MONTH, LAST_MONTH, ALL_TIME, CUSTOM_DATE, AUTO. For detail go https://tech.yandex.ru/direct/doc/reports/period-docpage/ |
DateFrom |
If your select CUSTOM_DATE in DateRangeType you must enter start date in this argument in YYYY-MM-DD format else you can not used this argument |
DateTo |
If your select CUSTOM_DATE in DateRangeType you must enter end date in this argument in YYYY-MM-DD format else you can not used this argument |
FieldNames |
Character vector with field names list, for example c("Date","CampaignName","Impressions","Clicks"), for more ditails go https://yandex.ru/dev/direct/doc/reports/fields-list-docpage |
FilterList |
Character vector with rows filters, for example c("Clicks GREATER_THAN 99","Impressions LESS_THAN 1000"), for more details go https://tech.yandex.ru/direct/doc/reports/filters-docpage/ |
Goals |
integer vector, id of the Yandex.Metric goals for which you want to get statistics. No more than 10 elements in the array. For example c(182453, 182452, 23458860). |
AttributionModels |
Attribution models used in the calculation of data on Yandex.Metrica goals. For example c("LSC", "LC", "FC"), see detail for more information. |
IncludeVAT |
Include or exclude VAT, one of "NO" or "YES" |
IncludeDiscount |
Include or exclude Discount, one of "NO" or "YES" |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
FetchBy |
Split the query by date range. Allowed values: "DAY", "WEEK", "MONTH", "QUARTER", "YEAR". |
TokenPath |
Path to directory where you save credential data |
Token |
character or list object, your Yandex API Token, you can get this by function yadirGetToken or yadirAuth |
SkipErrors |
Logical, if TRUE function skip all errors of API answer |
Details
Attribution model is the rule, what transition to consider the source of the visit.
Possible Values:
- FC
The first transition. The source of any visitor visits is his first visit to the site in the last 180 days. This model allows you to track the source of advertising, which first brought the client and thereby influenced all subsequent interactions with the site.
- LC
The last transition. The source of the visit is considered to be a transition, as a result of which the visitor is currently visiting the site, regardless of the history of visits. This model can be used in the technical analysis of the site. To assess the performance of advertising campaigns, use the Last significant transition model.
- LSC
Is the last significant transition. All sources of transitions for the last 90 days are conventionally divided into significant (your ads) and insignificant (transitions from saved pages, internal transitions or direct visits to the site). The source of the visit is considered to be an ad transition. If the visit occurred after an insignificant transition, then its source is considered the last transition on the ad. This model allows you to take into account the conversions that are lost in the model Last transition due to technical limitations on the duration of the visit.
- LYDC
Last click from Yandex.Direct. Of all the recent significant transitions, only Direct is taken into account. If a user at least once went to the site by an ad in Yandex.Direct, then this transition is considered the source of all subsequent visits - until the user clicks on the ad again. This model helps to see all the visits associated with the Directorate, including those that would be attributed to other sources in other attribution models.
The AttributionModels parameter can be specified only if the Goals parameter is specified. If the Goals parameter is specified, and the AttributionModels parameter is not, the default value is LSC.
If several attribution models are specified, the data will be displayed for each model separately.
Value
Data frame with the requested fields
Author(s)
Alexey Seleznev
References
Official docs of 'Service Reports'
See Also
For get more ditails see vignett vignette("yandex-direct-get-stat", package = "ryandexdirect")
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# For get Report from client account
statAgency <- yadirGetReport(ReportType = "ACCOUNT_PERFORMANCE_REPORT",
DateRangeType = "CUSTOM_DATE",
DateFrom = "2018-01-01",
DateTo = "2018-05-10",
FieldNames = c("AdNetworkType",
"Impressions",
"Clicks",
"Cost"),
Goals = c(182453,
182452,
234588),
AttributionModels = c("LSC", "LC"),
IncludeVAT = "YES",
IncludeDiscount = "NO",
Login = "client_login",
TokenPath = tempdir())
# For get data from agency client account
statAgency <- yadirGetReport(ReportType = "ACCOUNT_PERFORMANCE_REPORT",
DateRangeType = "CUSTOM_DATE",
DateFrom = "2018-01-01",
DateTo = "2018-05-10",
FieldNames = c("AdNetworkType",
"Impressions",
"Clicks",
"Cost"),
IncludeVAT = "YES",
IncludeDiscount = "NO",
Login = "client_login",
AgencyAccount = "aguncy_login",
TokenPath = tempdir())
## End(Not run)
Get Fast Links
Description
Returns sets of quick links that meet the specified criteria.
Usage
yadirGetSiteLinks(
Login = getOption("ryandexdirect.user"),
Token = NULL,
Ids = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Login |
character, your logins at Yandex Direct, require |
Token |
character, your Yandex Direct API Token, require |
Ids |
integer vector, ids of sitelinks sets |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Value
data frame with SiteLinks parameters, id, title, href and description
Author(s)
Alexey Seleznev
Examples
## Not run:
# Recomendation, please choose another TokenPath to save the Login permanently.
sl <- yadirGetSiteLinks(Login = "your.yandex.login",
Ids = c(5276537,
8927897239,
252627,
33123),
TokenPath = tempdir())
## End(Not run)
Auth in 'Yandex Direct' API
Description
Simplified, one-step API authorization.
Usage
yadirGetToken(Login = NULL, TokenPath = yadirTokenPath())
Arguments
Login |
character, your login at Yandex, require |
TokenPath |
Path to directory where you save credential data |
Value
R object with api token
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
myToken <- yadirGetToken(TokenPath = tempdir())
## End(Not run)
Get WordStat Report
Description
Returns a search query statistics report from 'Wordstat'.
Usage
yadirGetWordStatReport(
Phrases,
GeoID = 0,
Login = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Phrases |
character vector with yandex direct campaign ID, require |
GeoID |
character vectora, an array of key phrases for which you want to obtain statistics on search queries |
Login |
integer, An array of region identifiers. Allows you to get statistics on search queries made only in the specified regions, see yadirGetDictionary |
Token |
character, your Yandex Direct API Token, require |
AgencyAccount |
Your agency account login, if you get statistic from client account |
TokenPath |
Path to directory where you save credential data |
Value
Data Frame
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# get wordstat report
wsrep <- yadirGetWordStatReport(
Phrases = 'samsung smartphone',
Login = "abekker.ru.2017")
wsrep[['SearchedAlso']]
wsrep[['SearchedWith']]
## End(Not run)
Set Agency Account
Description
Set yandex direct Agency Account in current R session.
Usage
yadirSetAgencyAccount(AgencyAccount, TokenPath = yadirTokenPath())
Arguments
TokenPath |
Path to directory where you save credential data |
AgencyAccount |
Character, username of agency account in Yandex |
Value
TRUE
Author(s)
Alexey Seleznev
Examples
## Not run:
yadirSetAgencyAccount('my_agency')
## End(Not run)
Auto Set KeyWords Bids
Description
Assigns search phrases for phrases depending on the desired volume of traffic or rates in networks depending on the desired frequency of display (audience share).
Usage
yadirSetAutoKeyWordsBids(
KeywordIds = NULL,
AdGroupIds = NULL,
CampaignIds = NULL,
TargetTrafficVolume = NULL,
SearchIncreasePercent = NULL,
SearchBidCeiling = NULL,
TargetCoverage = NULL,
NetworkIncreasePercent = NULL,
NetworkBidCeiling = NULL,
Login = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
KeywordIds |
Phrase ID. Specified if you want to update the bid for an individual phrase. |
AdGroupIds |
Ad Group ID. Specified if you need to update bids for all group phrases. |
CampaignIds |
Campaign ID. Specified if you need to update bids for all campaign phrases. |
TargetTrafficVolume |
The desired amount of traffic on the search. It is specified in percents from 5 to 100. The surcharge is added to the rate corresponding to the selected traffic volume (see the SearchIncreasePercent parameter). |
SearchIncreasePercent |
Percentage of markup on search from 0 to 1000. If not specified, the markup is not calculated. |
SearchBidCeiling |
Limit on bid on search. Integer. Indicated in the currency of the advertiser. |
TargetCoverage |
The desired frequency of display (audience share) in the networks. It is specified in percents from 1 to 100. The surcharge is added to the rate corresponding to the selected display frequency (see the NetworkIncreasePercent parameter). |
NetworkIncreasePercent |
Percentage of markup on network from 0 to 1000. If not specified, the markup is not calculated. |
NetworkBidCeiling |
Limit on network bid. Integer. Indicated in the currency of the advertiser. |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Search.
The rate corresponding to the traffic volume TargetTrafficVolume × (1 + SearchIncreasePercent / 100)
, but no more SearchBidCeiling
.
Over time, the activity of competitors can raise the rate for the desired amount of traffic, and it will exceed the advertiser's rate. The higher the surcharge, the greater the volume of traffic, but the higher the possible costs.
Network.
The rate corresponding to the display frequency TargetCoverage × (1 + NetworkIncreasePercent / 100)
, but no more NetworkBidCeiling
.
Over time, the activity of competitors can raise the bid for the desired frequency of display, and it will exceed the advertiser's bid. The higher the surcharge, the higher the frequency of display, but the higher the possible costs.
Value
List with result data, object ids, warnings and errors.
Author(s)
Alexey Seleznev
References
KeyWord Bids API documentation KeyWord Bids setAuto method API documentation
Examples
## Not run:
# loading keywords list
kw <- yadirGetKeyWords()
# set bid on search
autosetbids_search <-
yadirSetAutoKeyWordsBids(TargetTrafficVolume = 5,
KeywordIds = kw$Id)
# set bid on network
autosetbids_network <-
yadirSetAutoKeyWordsBids(TargetCoverage = 15,
KeywordIds = KeywordIds)
## End(Not run)
Set KeyWords Bids
Description
Assigns fixed bids and priorities for keyword phrases and auto-targeting.
Usage
yadirSetKeyWordsBids(
KeywordIds = NULL,
AdGroupIds = NULL,
CampaignIds = NULL,
StrategyPriority = c(NA,
"LOW",
"NORMAL",
"HIGH"),
SearchBid = NULL,
NetworkBid = NULL,
Login = getOption("ryandexdirect.user"),
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
KeywordIds |
Phrase ID. Specified if you want to update the bid for an individual phrase. |
AdGroupIds |
Ad Group ID. Specified if you need to update bids for all group phrases. |
CampaignIds |
Campaign ID. Specified if you need to update bids for all campaign phrases. |
StrategyPriority |
The priority of the phrase: LOW, NORMAL or HIGH. Only for automatic strategy. |
SearchBid |
Bid on search. |
NetworkBid |
Bid on network. |
Login |
Your Yandex Login. |
AgencyAccount |
Your agency account login, if you get statistic from client account. |
Token |
Your Yandex API Token. |
TokenPath |
Path to directory where you save credential data. |
Details
You can set a bet or priority:
for a separate keyword phrase or autotarget.
for all keyword phrases and autotargeting in an ad group.
for all keyword phrases and autotargets in the campaign.
You can set a bid or priority depending on which display strategy is selected in the campaign:
if the display strategy is selected on the
HIGHEST_POSITION
search, you can specify the SearchBid parameter.if you selected a display strategy on
MAXIMUM_COVERAGE
orMANUAL_CPM
networks, you can specify the NetworkBid parameter.if the automatic strategy is selected, you can specify the StrategyPriority parameter: phrases with a higher priority receive as much traffic as possible, and in case of a budget deficit, they are turned off last.
If the element of the input array contains parameters that do not correspond to the strategy, the values of these parameters will not be changed:
If the input array element contains both parameters corresponding to the strategy and parameters that do not correspond to the strategy (for example, both the bid and priority), then as a result of the operation, the values of only the parameters corresponding to the strategy will be changed and a warning will be issued.
If the input array element contains only parameters that do not correspond to the strategy (for example, only the priority for a manual strategy), the operation will fail and an error will be returned.
Value
List with result data, object ids, warnings and errors.
Author(s)
Alexey Seleznev
References
See Also
See for get and autoset keyword bids yadirGetKeyWordsBids()
and yadirSetAutoKeyWordsBids()
Examples
## Not run:
# loading keywords list
kw <- yadirGetKeyWords()
# set bid on search
setbid <- yadirSetKeyWordsBids(KeywordIds = kw$Id,
SearchBid = 9)
## End(Not run)
Set Login
Description
Set yandex direct login in current R session.
Usage
yadirSetLogin(Login, TokenPath = yadirTokenPath())
Arguments
TokenPath |
Path to directory where you save credential data |
Login |
Character, your username in Yandex |
Value
TRUE
Author(s)
Alexey Seleznev
Examples
## Not run:
yadirSetLogin('my_name')
## End(Not run)
Start Ads
Description
Resumes ad impressions previously stopped by the owner.
Usage
yadirStartAds(Login = getOption("ryandexdirect.user"), Ids = NULL,
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Ids |
Integer or Character vector with Ads Ids, who will resume impressions |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Function resume impressions and return vector with Ads Ids with error.
Value
Vector with ads ids which failed to resume impressions
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# Get API token
tok <- yadirGetToken(TokenPath = tempdir())
# Get ads dictionary
my_ads <- yadirGetAds(Login = "LOGIN",
Token = tok,
States = c("SUSPENDED","OFF"))
# Resume impressions
err <- yadirStartAds(Login = "LOGIN",
Token = tok,
Ids = my_ads$Id)
## End(Not run)
Start Campaigns
Description
Resumes impressions at the campaign level.
Usage
yadirStartCampaigns(Login = getOption("ryandexdirect.user"),
Ids = NULL, Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Ids |
Integer or Character vector with Campaigns Ids, who will resume impressions |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Function resume impressions and return vector with Campaigns Ids with error.
Value
Vector with campaigns ids which failed to resume impressions
Author(s)
Alexey Seleznev
Examples
## Not run:
# Get API token
### !!!Please choose another TokenPath to save the Login permanently.
tok <- yadirGetToken(TokenPath = tempdir())
# Get camp dictionary
my_camp <- yadirGetCampaignList(Login = "Login", Token = tok,
TokenPath = tempdir())
# Resume impressions
err <- yadirStartCampaigns(Login = "LOGIN", Token = tok, Ids = my_camp$Id,
TokenPath = tempdir())
## End(Not run)
Resume KeyWords
Description
Resumes impressions on previously stopped keyword phrases and auto-targeting.
Usage
yadirStartKeyWords(Login = getOption("ryandexdirect.user"), Ids = NULL,
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Ids |
Integer or Character vector with KeyWords Ids, who will resume impressions |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Function resume impressions and return vector with KeyWords Ids with error.
Value
Vector with keywords ids which failed to resume impressions
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# Get API token
tok <- yadirGetToken(TokenPath = tempdir())
# Get camp dictionary
my_camp <- yadirGetCampaignList(Login = "Login",
Token = tok,
TokenPath = tempdir())
# Get keywords dictionary
my_kw <- yadirGetKeyWords(Login = "Login", Token = tok,
CampaignIds = my_camp$Id[1:10],
TokenPath = tempdir())
# Resume impressions
err <- yadirStartKeyWords(Login = "LOGIN", Token = tok,
Ids = my_kw$Id,
TokenPath = tempdir())
## End(Not run)
Suspend impressions by Ads
Description
Stops Ad Impressions in 'Yandex Direct' accounts.
Usage
yadirStopAds(Login = getOption("ryandexdirect.user"), Ids = NULL,
Token = NULL, AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Ids |
Integer or Character vector with Ads Ids, who will suspend impressions |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Function resume impressions and return vector with Ads Ids with error.
Value
Vector with ads ids which failed to suspend impressions
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# Get API token
tok <- yadirGetToken(Login = "LOGIN",
TokenPath = tempdir())
# Get Campaigns
my_camp <- yadirGetCampaignList(Login = "LOGIN",
Token = tok)
# Get ads dictionary
my_ads <- yadirGetAds(Login = "LOGIN",
Token = tok,
States = "ON",
CampaignIds = my_camp$Id[1:10])
# Resume impressions
err <- yadirStopAds(Login = "LOGIN", Token = tok, Ids = my_ads$Id)
## End(Not run)
Suspend impressions by Campaigns
Description
Suspend impressions by campaings in 'Yandex Direct' account
Usage
yadirStopCampaigns(
Login = getOption("ryandexdirect.user"), Ids = NULL,
Token = NULL,
AgencyAccount = getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Ids |
Integer or Character vector with Campaigns Ids, who will suspend impressions |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Function suspend impressions and return vector with Campaigns Ids with error.
Value
Vector with campaigns ids which failed to suspend impressions
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# Get API token
tok <- yadirGetToken(TokenPath = tempdir())
# Get camp dictionary
my_camp <- yadirGetCampaignList(Login = "Login", Token = tok)
# Resume impressions
err <- yadirStopCampaigns(Login = "LOGIN", Token = tok, Ids = my_camp$Id)
## End(Not run)
Suspend impressions by KeyWords
Description
Stops impressions by keyword phrases and autotargeting.
Usage
yadirStopKeyWords(Login = getOption("ryandexdirect.user"), Ids = NULL,
Token = NULL, AgencyAccount
= getOption("ryandexdirect.agency_account"),
TokenPath = yadirTokenPath())
Arguments
Ids |
Integer or Character vector with KeyWords Ids, who will suspend impressions |
Login |
Your Yandex Login |
AgencyAccount |
Your agency account login, if you get statistic from client account |
Token |
Your Yandex API Token |
TokenPath |
Path to directory where you save credential data |
Details
Function suspend impressions and return vector with KeyWords Ids with error.
Value
Vector with keywords ids which failed to suspend impressions
Author(s)
Alexey Seleznev
Examples
## Not run:
### Please choose another TokenPath to save the Login permanently.
# Get API token
tok <- yadirGetToken(TokenPath = tempdir())
# Get camp dictionary
my_camp <- yadirGetCampaignList(Login = "Login", Token = tok)
# Get keywords dictionary
my_kw <- yadirGetKeyWords(Login = "Login", Token = tok, CampaignIds = my_camp$Id[1:10])
# Resume impressions
err <- yadirStopKeyWords(Login = "LOGIN", Token = tok, Ids = my_kw$Id)
## End(Not run)