Connect to the CJA API, which powers CJA Workspace. The package was developed with the analyst in mind and will continue to be developed with the guiding principles of iterative, repeatable, timely analysis. New features are actively being developed and we value your feedback and contribution to the process. Please submit bugs, questions, and enhancement requests as issues in this Github repository.
# Install from CRAN
install.packages('cjar')
# Load the package
library(cjar)
# Install devtools from CRAN
install.packages("devtools")
# Install adobeanayticsr from github
devtools::install_github('searchdiscovery/cjar')
# Load the package
library(cjar)
There are four setup steps required to start accessing your Customer Journey Analytics data. The following steps are each outlined in greater detail in the following sections:
.Renviron
file.cja_auth()
.Data View ID
by using the function
cja_get_dataviews()
.When using JWT authentication, you only need an Adobe Console API project for each organization you are needing to access.
Once you are a developer for a CJA product profile, you can create an API client in the Adobe Developer Console.
.json
file. Reference
?cja_auth
for more information on the variables needed.
Using the preconfigured JSON file is the easiest method.This file is essential to keeping your information secure. It also speeds up analysis by limiting the number of arguments you need to add to every function call.
.Renviron
file (if you have never
heard of this file you almost certainly don’t have one!), then create a
new file and save it with the name .Renviron
. You can do
this from within the RStudio environment and save the file either in
your Home
directory (which is recommended; click on the
Home button in the file navigator in RStudio and save
it to that location) or within your project’s working
directory. You can also use the “usethis”
package to create the file by running the function
edit_r_environ(scope = "user")
.Renviron
file using the file location path for both, the json (auth) file and the
private key file. The format of variables in the .Renviron
file is straightforward.## JWT creds ##
CJA_AUTH_FILE=filelocation.json
CJA_PRIVATE_KEY=private.key
After adding these 2 variables to the .Renviron
file and
saving it, restart your R session (Session > Restart
R in RStudio) and reload the package
(library(cjar)
).
The token is actually a lonnnnng alphanumeric string that is the what ultimately enables you to access your data:
cja_auth()
and press
Enter.All data in CJA is located in Data Views, similar to Report Suites in Adobe Analytics. Before pulling data it is essential to locate the data view id you are attempting to pull from.
#Pull a list of available data views
dv <- cja_get_dataviews(expansion = c('name', 'description'))
#note: see function documentation for all availabe expansion metadata available.
Once you have the data view ID you want then you can begin pulling data using the different functions.