Creates a skeleton shell for accessing the Google Analytics API.
Returns a list of methods, for accessing the Google Analytics API. GetXmlDataFeed(), GetRDataFromXML(), SetCredentials(), GetProfileXML(), GetProfileData(), GetReportData(), For more information please look at the help pages for each function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ga <- RGoogleAnalytics()
ga$SetCredentials("INSERT_USER_NAME", "INSERT_PASSWORD")
# Get the list of different profiles, to help build the query.
prof <- ga$GetProfileList()
# Build the query.
query.builder <- QueryBuilder()
query.builder$Init(start.date = "2010-05-01",
end.date = "2010-08-20",
dimensions = "ga:date",
metrics = "ga:visits",
sort = "ga:date",
table.id = "ga:30661272")
ga.data <- ga$GetRDataFromQuery(query.builder)
# Look at the data returned.
head(ga.data$data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.