
Loading Criteo Campaign Data into R
View the Project on GitHub jburkhardt/RCriteo
Author: Johannes Burkhardt
The aim of RCriteo is loading Criteo online advertising campaign data into R. The package provides an authentication process for R with the Criteo API. Moreover, the package features an interface to query campaign data from the Criteo API. The data can be downloaded and will be transformed into a R data frame.
The package can be installed directly from this Github repository with:
install.packages("RCriteo")
The function doCriteoAuth manages the complete authentication process and returns an authentication token.
scedCriteoReport generates the campaign report statement and schedules the report.
The API returns a job ID, which will later be used to receive the data.
getCriteoCampaigns loads campaign information including campaign IDs.
criteoData manages the complete data download process. The function returns the requested data as data frame.
getCriteoJobStatus monitors if the API processed the report.
getCriteoDownloadURL returns the download Url of the report.
getCriteoData loads the data into as R data frame.
getCriteoAccount returns the account information.
getCriteoCampaigns returns list of Campaigns and additional information.
library(RCriteo)
authToken <- doCriteoAuth(user = "userName",
password = "**********",
company = "companyName",
app = "appName",
version = "3.6")
getCriteoCampaigns(authToken = authToken,
appToken = '*************')
jobID <- scedCriteoReport(authToken = authToken,
appToken = '*************',
campaigns = c("12345", "23345", "98765", "45639"),
metrics = c("clicks", "impressions", "cost", "sales"),
start = "2014-01-01",
end = "2014-01-31")
data <- criteoData(authToken = authToken, appToken = '*************', jobID = jobID)
jobStatus <- getCriteoJobStatus(authToken = authToken,
appToken = '************',
jobID = jobID)
URL <- getCriteoDownloadURL(authToken = authToken,
appToken = '************',
jobID = jobID)
data <- getCriteoData(URL = URL,
jobID = jobID)