Skip to content

Instantly share code, notes, and snippets.

@randyzwitch
Last active February 3, 2016 22:12
Show Gist options
  • Save randyzwitch/7858752 to your computer and use it in GitHub Desktop.
Save randyzwitch/7858752 to your computer and use it in GitHub Desktop.
Code to generate Adobe Analytics Implementation Documentation
library("RSiteCatalyst")
library("WriteXLS")
#Validate that underlying Perl modules for WriteXLS are installed correctly
#Will return "Perl found. All required Perl modules were found" if installed correctly
testPerl()
#### 1. Pull data for all report suites to create one comprehensive report ####
#Authenticate with Adobe Analytics API
SCAuth("user:company", "sharedsecret")
#Get Report Suites
report_suites <- GetReportSuites()
#Get Available Elements
elements <- GetElements(report_suites$rsid)
#Get eVars
evars <- GetEvars(report_suites$rsid)
#Get Segments
segments <- GetSegments(report_suites$rsid)
#Get Success Events
events <- GetSuccessEvents(report_suites$rsid)
#Get Traffic Vars
props <- GetProps(report_suites$rsid)
#### 2. Generate a single Excel file
#Create list of report suite objects, written as strings
objlist <- c("report_suites", "elements", "evars", "segments", "events", "props")
#Write out Excel file with auto-width columns, a bolded header row and filters turned on
WriteXLS(objlist, "/Users/randyzwitch/Desktop/adobe_analytics_implementation_doc.xlsx",
AdjWidth = TRUE, BoldHeaderRow = TRUE, AutoFilter = TRUE)
@beskelton
Copy link

Apologies if not the proper way to comment, but may want to abstract out your filename in the WriteXLS line so folks don't try to create the xls file in a directory that doesn't exist. Should be obvious, but not everyone has the same obvious filters...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment