简体   繁体   中英

How to get pageviews data for a separate page in GoogleAnalytics API

I am using GoogleAnalytics API library on my Codeigniter site, but i didn't find there and on Google API guide - how to get results for a one exact page.

Say i've got page http://www.example.com/company/82808 , and i make request to GA API and get pageviews and visitors metrics for this URL - example.com/company/8280.

Is this possible?

Yes, it's possible. Apply a filter for ga:pagePath

Include in the request:

Dimension: ga:pagePath

Metrics: ga:pageviews,ga:visitors

Filter: filter=ga:pagePath==/company/82808 use this exact match if that is how the page is recorded in GA. If it's recorded like /company/82808/index.php then you can use filter=ga:pagePath==/company/82808/index.php or ga:pagePath=~/company/82808 for a contains match.

Test out queries in Google's Data Feed Query Explorer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM