# session in descending order
ga_data_order(-sessions)
# city dimension in ascending alphanumeric order
ga_data_order(+city)
# as above plus sessions in descending order
ga_data_order(+city -sessions)
# as above plus activeUsers in ascending order
ga_data_order(+city -sessions +activeUsers)
# dayOfWeek dimension in ascending numeric order
ga_data_order(+dayOfWeek, type = "NUMERIC")
# you can also combine them with c()
a <- ga_data_order(-sessions)
b <- ga_data_order(-dayOfWeek, type = "NUMERIC")
c(a, b)
if (FALSE) {
# example of use
ga_data(
206670707,
metrics = c("activeUsers","sessions"),
dimensions = c("date","city","dayOfWeek"),
date_range = c("2020-03-31", "2020-04-27"),
orderBys = ga_data_order(-sessions -dayOfWeek)
)
}
Run the code above in your browser using DataLab