yadirGetCostData: Loading Cost Data for Upload to Google Analytics

Description Usage Arguments Value Author(s) Examples

View source: R/yadirGetCostData.R

Description

Get data on expenses, impressions and clicks on advertising campaigns, keywords and ads for further loading into 'Google Analytics' source.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## 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)

ryandexdirect documentation built on July 1, 2020, 10:39 p.m.