Search code examples
real-timegoogle-analytics-api

How to get active users of a specific page by Google analytics API?


I use rt:activeUsers metric to get active users on website for realtime data.

I want to get active users in real time for a specific page (path or url), not the whole website. Is there a way to implement it? I went through API Explorer but gain no success.


Solution

  • While the Real-time API is very limited it does allow you to use filters. Filters are a kind of where clause.

    The real-time documentation is also very limited but you can look at the documentation for filters on the core reporting API it works the same

    filters=ga:browser%3D~%5EFirefox
    

    I think you should check out the dimension rt:pagePath its probably what you are looking for.