wojtekmo / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

Core Reporting API - ga:pagePath filters not working #695

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Developers,

I wrote following in Adwords Scripts platform by accessing Analytics API to 
extract GA Sessions based on Segment of 'Page matches regex'. It gives wrong 
result when executed. If I use filter ga:landingPagePath, then it gives correct 
results. It means that Analytics API is unable to apply filter ga:pagePath 
correctly. Kindly get it corrected.
function main() {
//runGaReport();
var tests = Analytics.Data.Ga.get('ga:50435929', '2015-06-28', '2015-06-28', 
'ga:sessions', { 'filters': 'ga:pagePath=~^/bus-booking|/bus/', 
'samplingLevel':'HIGHER_PRECISION'});
Logger.log(tests.rows); 
}

It returns result:
Time    Log
18:26:26.146    [[917, 2375, 10452]]

But the actual result (by using GA website) is [[2572,2375,26821]].
So,There is a huge difference in sessions & pageviews but no. of users is 
correct.

Kindly help me to correct this.

Original issue reported on code.google.com by saurabh....@gmail.com on 7 Jul 2015 at 4:56

Attachments:

GoogleCodeExporter commented 8 years ago
Is there a timeline by when this would be corrected?
How can you continue with such an issue for so long?

Original comment by saurabh....@gmail.com on 15 Jul 2015 at 10:40

GoogleCodeExporter commented 8 years ago
I'm seeing a similar problem when trying to get the number of sessions for a 
section of the site when filtering by ga:pagePath.

Specifically, the query is:

    query = service.data().ga().get(
        ids=profile_id,
        start_date=s,
        end_date=e,
        metrics='ga:sessions',
        dimensions='ga:date',
        max_results=max_results,
        start_index=start_index,
        filters='ga:pagePath=~%s/' % p).execute()

The data (ga:date, ga:sessions) returned is along the lines of:

    20150901    0
    20150902    1
    ...

and the numbers for the metrics are much lower than what's presented in the GA 
site.

However, I noticed something that may provide a lead in troubleshooting.  

For a specific date (or date range), the total number of sessions filtered by 
ga:pagePath is *exactly equal* to the number of 'Entrances' (see screenshot) 
when going to 'Behavior -> Site Content -> All Pages', and filtering by the 
section URL.

And, running the same query, but filtering on ga:landingPagePath instead of 
ga:pagePath, I get the exact same number of sessions for both queries.  So, it 
appears that the API backend is effectively using the 'ga:landingPagePath' 
filter in place of the 'ga:pagePath' filter.

Thanks!

--Tim

Original comment by simki...@gmail.com on 9 Dec 2015 at 5:21

Attachments: