简体   繁体   中英

google analytics api php, how to access total sessions for all landing pages that start with a certain url

i want to access the total number of sessions for landing pages that start with the url "/biz".

Here are the dimensions and metrics I am using:

    $dimensions = "ga:landingpagePath";
    $metrics = "ga:sessions";
    $filters = "ga:landingpagePath=~^/biz"; 
    $sort = "-ga:sessions";

But this prints out the individual pages and sessions for each. I want all of these sessions added up. And I cant write a program to do it myself because there are just too many of them and they exceed the limit.

Don't use the dimension ga:landingPagePath if you want to get the aggregated value. If you have to set dimensions to a non-blank value use something with just one row expecting like ga:hostname.

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