https://github.com/kxzk/datoramar
📦 R interface to the Datorama Query & Platform API
https://github.com/kxzk/datoramar
datorama marketing r
Last synced: 6 months ago
JSON representation
📦 R interface to the Datorama Query & Platform API
- Host: GitHub
- URL: https://github.com/kxzk/datoramar
- Owner: kxzk
- License: other
- Created: 2017-12-19T04:52:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-06-28T09:03:54.000Z (almost 7 years ago)
- Last Synced: 2025-10-10T18:34:25.933Z (8 months ago)
- Topics: datorama, marketing, r
- Language: R
- Homepage: https://developers.datorama.com/
- Size: 19.5 KB
- Stars: 11
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DatoramaR
An interface to the [Datorama](https://datorama.com) Query & Platform API.
[](https://travis-ci.org/kadekillary/datoramar) [](http://www.r-pkg.org/badges/version/datoramar)

Â
## Overview
Datorama has two APIs: the Query API and the Platform API. This package interfaces with both. The Query API is for retrieving data out of Datorama. The Platform API is for interacting with the platform directly.
As of right now, only the Query API and Data Stream Processing endpoints are supported.
Â
## Installation
Install from Github
```r
devtools::install_github('kadekillary/datoramar')
```
Â
## Authentication
All API requests must authenticate using your personal API access token. The token can be found inside the Datorama platform under "My Profile" below your email address.
Conversely, create an `.Renviron` file and specify your `ACCESS_TOKEN` in there. Now you can call it via R using `Sys.getenv("ACCESS_TOKEN")`.

Â
## Usage
Once you have your token, you can run a query using `datorama_query()`. This function will return the Query API's response as a tibble.
`datorama_query()`
```r
datorama_query(access_token = "dato-api-31i9a14b-b41d-323h-2f79-379nxhfdf8123",
workspaceId = "999999",
dateRange = "CUSTOM",
startDate = "2017-11-01",
endDate = "2017-11-22",
measurements = list(list(name = "Clicks"),
list(name = "Impressions")),
dimensions = list("Date", "Site Name")
)
```
You can also use this API wrapper to automate the processing of particular Data Streams. You will need to specify the Data Stream by it's ID and specify a time window.
`datorama_process()`
```r
datorama_process(acces_token = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
dataStreamIds = list(348937, 34289),
startDate = "2018-01-01",
endDate = "2018-01-20"
)
```