ga = GA("./tools/testing.json")
-OR-
gaToken = analytics.connect("./tools/testing.json")
View(ga$accounts);
-OR-
gaAccounts = analytics.accounts(gaToken);
gaDims = ga$getDimensions(accountID = ga$accounts[12]$accountID, webID = ga$accounts[12]$id);
# By default, ga$query pulls the data from the last 30 days
data = ga$query(
accountID = ga$accounts[12]$accountID,
webID = ga$accounts[12]$id,
ids = ga$accounts[12]$profiles[[1]][1]$id,
uniqueBy = levels(droplevels(gaDims[c(2,8),]$id)),
columnNames = gaDims
)
View(data$merged)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.