GoogleAnalyticsR api - FilterExpression

耗尽温柔 提交于 2019-12-11 11:24:57

问题


I need to retrieve data from google analytics using R

I write the following code with GoogleAnalyticsR:

df <- google_analytics(viewId = my_id, 
                     date_range=c(start,end), 
                     metrics = c("pageViews"), 
                     dimensions = "pagePath",
                     anti_sample = TRUE,
                     filtersExpression ="ga:pagePath==RisultatoRicerca?nomeCasa",
                     max=100000)

I need to set correctly the FiltersExpression parameters. I 'd like to have data from pagePath that contains RisultatoRicerca?nomeCasa. This code returns me a dataframe with 0 rows, which i know it's impossible ( data from an e-commerce with more than ten thousand interaction per day). So i 've begun to think that my FiltersExpression is incorrect.

Thanks in advance


回答1:


I managed to solve the problem using filtersExpression

filtersExpression = "ga:pagePath=@RisultatoRicerca?nomeCasa

this filter works on pagePath dimension and filter every path that contain RisultatoRicerca



来源:https://stackoverflow.com/questions/50799283/googleanalyticsr-api-filterexpression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!