datoramar

Interface to the 'Datorama' API


License
MIT

Documentation

DatoramaR

An interface to the Datorama API.

Build Status CRAN status

logo

 

Why?

Datorama has a Query API constructor under the Analyze tab, but it's tedious. It's a nice tool to graphically build your JSON request and see the results. However, this package allows for a cleaner interface. This package has two functions: datorama_token() and datorama_query(). You'll need an account with Datorama in order to authenticate yourself. After that, you are good to go. This can be a great tool to take your company's marketing data and turn it into an automated email report or Shiny dashboard.

 

Installation

Install from CRAN

install.packages('datoramar')

Install from Github

devtools::install_github('beigebrucewayne/datoramar')

 

Authenticate

  1. You're going to need a paying Datorama account
  2. You'll also need an account with permission to access the API
  3. Run datorama_token() with your email and password

 

Usage

Once you have your token, you can run a query using datorama_query(). This function will return the API's response as a tibble. Another example, using curl and JSON, can be seen here.

datorama_token() :: authentication

myToken <- datorama_token("analytics@data.com", "password1234")

datorama_query() :: run your query

datorama_query(token = myToken,
               brandId = "271",
               dateRange = "CUSTOM",
               startDate = "2017-11-01",
               endDate = "2017-11-22",
               measurements = list(list(name = "Clicks"),
                                   list(name = "Impressions")),
               dimensions = list("Date", "Site Name")
)