rym-expense-uploading: Manage Cost Data Upload

Description Usage Arguments Details Author(s) References Examples

Description

Upload, delete and get list of uploading expense data in 'Yandex Metrica'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
rym_upload_expense(
    counter, 
    data,
    comment    = paste0("Upload bt rym at ", Sys.time()),
    login      = getOption("rym.user"), 
    token.path = getOption("rym.token_path"))

rym_delete_uploaded_expense(
    counter, 
    data,
    comment    = paste0("Upload bt rym at ", Sys.time()),
    login      = getOption("rym.user"), 
    token.path = getOption("rym.token_path"))
    
rym_get_uploadings_expense(
    counter, 
    login      = getOption("rym.user"), 
    token.path = getOption("rym.token_path"))

Arguments

counter

Your yandex metrica counter

data

data.frame, expense data for loading

comment

Comment for data loading

login

character, Your Yandex login

token.path

character, Directory for store API credential

Details

Loading data format.

Require:

Date

Date in YYYY-MM-DD format

UTMSource

Source name, for example google

Expenses

Expense size, for example 12.34

Optional:

UTMMedium

Medium name, for exmaple cpc

UTMCampaign

Campaign name, for example my campaing

UTMTerm

Term name, for example my term

UTMContent

Content name, for example my contant

Currency

Currency in ISO 4217 code

Clicks

Clicks number, for example 23

Author(s)

Alexey Seleznev

References

See official dox: API documents Yandex Metrica documents

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## Not run: 
# prepare data for loading
expense <- data.frame(Date        = c("2020-06-01",
                                      "2020-06-02"),
                      UTMSource   = c("test_s_1",
                                      "test_s_2"),
                      Expenses    = c(88.12,
                                      92.11),
                      UTMMedium   = c("cpc",
                                      "cpm"),
                      UTMCampaign = c("camp1",
                                      "camp2"),
                      UTMTerm     = c("term1",
                                      "term2"),
                      UTMContent  = c("cont1",
                                      "cont2"),
                      Currency    = c("RUB", 
                                      "RUB"),
                      Clicks      = c(11, 15))

# upload data
rym_upload_expense(
                counter = 1111111, 
                data    = expense,
                login   = 'yandex_login')

# delete data
rym_delete_uploaded_expense(
                counter = 1111111, 
                data    = expense,
                login   = 'yandex_login')

# get list of expense uploadings
loaded <- rym_get_uploadings_expense(
                counter = 1111111, 
                login   = 'yandex_login')


## End(Not run)

rym documentation built on Aug. 12, 2020, 5:09 p.m.