Learn R Programming

rym (version 1.0.6)

rym_get_logs: Get raw data from yandex metrika.

Description

'Logs API' allows you to receive non-aggregated data collected by Yandex.Metrica. This API is intended for service users who want to independently process statistical data and use them to solve unique analytical problems.

Usage

rym_get_logs(counter = NULL, date.from = Sys.Date() - 10, date.to =
    Sys.Date() - 1, fields =
    "ym:s:date,ym:s:counterID,ym:s:dateTime,
	ym:s:isNewUser,ym:s:startURL,ym:s:visitDuration,
	ym:s:ipAddress,ym:s:referer",
    source = "visits", login = getOption("rym.user"), 
	token.path = getOption("rym.token_path"))

Value

Data frame with values and fields

Arguments

counter

Yandex metrika counter id

date.from

Start date in format YYYY-MM-DD

date.to

End date in format YYYY-MM-DD

fields

List of fields

source

Log source, one of "hits" or "visits"

login

character, Your Yandex login

token.path

character, Directory for store API credential

Author

Alexey Seleznev

References

Visits fields

Hits fields

Logs API docs

Docs on rym website

Run vignette("rym-logs-api", package = "rym") to see the corresponding vignette.

See Also

For load statics you also can use rym_get_data() and rym_get_ga()

Examples

Run this code
if (FALSE) {
# where "00000000" is your counter id
rawmetrikdata <- rym_get_logs(counter = "00000000",
                              date.from = "2016-12-01",
                              date.to = "2016-12-20",
                              fields = "ym:s:visitID,
							            ym:s:date,
										ym:s:bounce,
										ym:s:clientID,
										ym:s:networkType",
                              source = "visits")
}

Run the code above in your browser using DataLab