I'm using RGoogleAnalytics and trying to output Custom Dimension using Google APIs. Google announced that "Developers can use custom dimensions to send unique IDs into Google Analytics, and then use the core reporting API to retrieve these IDs along with other Google Analytics data."
My query is like this :
library("RGoogleAnalytics")
client.id <- "xxx....apps.googleusercontent.com"
client.secret <- "xxx..IoG"
token <- Auth(client.id,client.secret)
save(token,file="./token_file")
query.list <- Init(start.date = "2014-12-01",
end.date = "2014-12-01",
dimensions = "ga:dimension1==UserID",
metrics = "ga:sessions ",
max.results = 10000,
sort = "- ga:dimension1",
table.id = "ga:xxxxx58")
ga.query <- QueryBuilder(query.list)
ga.data <- GetReportData(ga.query, token)
and this produces the error : code : 400 Reason : Invalid dimension or metric: ga:dimension1==UserID.
UserID is one of the custom dimension and I can view the list of UserID from the Custom Report. My goal is to get the list of UserID using RGoogleAnalytics. However, I'm not sure what value I need to pass in the code to query custom dimension, (or whether this is even possible using RGoogleAnalytics.)