Repository of useful functions.
AMPRestAPI
A simple function that extracts Referrals by a list of URLs you provide.
Load the dependent Library
library("RGA")
Authorize your GA account
authorize()
- view: the GA view id you are extracting the data from
- startDate / endDate: your preferred date range
- urls: this needs to be passed as a list
- example:
urls <- c( "l.facebook.com", "lm.facebook.com" )
- example:
see GAReferrals.R
view <- "1234567"
startDate <- "2017-01-01"
endDate <- "2017-01-31"
urls <- c(
"l.facebook.com",
"lm.facebook.com"
)
x <- getReferrals(view,startDate,endDate,urls)