jlavitt / analytics-issues

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

dynamic segment regex for ga:pagePath doesn't filter data results #89

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Name of API affected:
Analytics Data Export API

Issue summary:
I am trying to retrieve data using the URI:

https://www.google.com/analytics/feeds/data?ids=ga%3Axxxxxxxx&dimensions=ga%3Aye
ar%2Cga%3Amonth&metrics=ga%3Apageviews%2Cga%3Avisits%2Cga%3Avisitors%2Cga%3Atime
OnSite&segment=dynamic%3A%3Aga%3ApagePath%3D~%2Fsoftware%2Fxxxx&start-date=2008-
10-01&end-date=2010-06-30&max-results=999 

where the x's have covered private data. This uri is working quite fine in the 
Data Feed Query Explorer, but when attempting to use the gdata python libraries 
with the above dynamic segment, the data I get back is the same as if I never 
included the segment.

At first I thought the issue might have been the python libraries or my code, 
but the returned XML has the segment listed in it. I even copied the URI 
directly from the Data Feed Query Explorer and forced my program to use it 
instead of the python created version, but alas, my data still returned as if 
the API ignored the 'segment=dynamic::ga:pagePath=~/software/xxxx' part.

Steps to reproduce issue:
1. Use the above URI to make a gdata query that segments according to a regular 
expression on ga:pagePath
2. Compare the data to the same URI without the segment.

Expected output:
Numbers that are lower that match the Data Feed Query Explorer.
The numbers should be smaller with the segment than without the segment since 
they represent only part of the website.

Actual results:
Adding the segment doesn't change the numbers at all when accessing the API, 
even though they do change when the segment is added in using the Data Feed 
Query Explorer.

Original issue reported on code.google.com by wearesch...@gmail.com on 30 Jun 2010 at 11:54

GoogleCodeExporter commented 9 years ago
Strange. Is there any way you can provide the actual URI of the request being 
sent to the GA from this library?

It's not clear if that is what you are showing above.

Original comment by nickski1...@gmail.com on 1 Jul 2010 at 1:07

GoogleCodeExporter commented 9 years ago
https://www.google.com/analytics/feeds/data?ids=ga%3A12193488&dimensions=ga%3Aye
ar%2Cga%3Amonth&metrics=ga%3Apageviews%2Cga%3Avisits%2Cga%3Avisitors%2Cga%3Atime
OnSite&segment=dynamic%3A%3Aga%3ApagePath%3D~%2Fsoftware%2Fjira&start-date=2008-
10-01&end-date=2010-06-30&max-results=999

This is one of many URIs that are all experiencing the same issue. The only 
difference between them is the regex for the pagePath. The URI above is just 
hiding the table ID and some of the pagePath, which, in retrospect, doesn't 
really matter if other people see it since they don't have authentication.

Original comment by wearesch...@gmail.com on 1 Jul 2010 at 1:30

GoogleCodeExporter commented 9 years ago
I just tested this on my account using your same dims and mets. Applying a 
segment does change the values. So this is working for me. A couple things to 
consider, Are you supplying a string or using the DataFeedQuery object to form 
your query. If our API finds a mal-formatted parameter it will ignore it. Maybe 
this is what is happening?

Original comment by nickski1...@gmail.com on 1 Jul 2010 at 5:56

GoogleCodeExporter commented 9 years ago
I tried both methods. 

I tried using a DataFeedQuery object, which in the python library takes 
segments in through its 'params' argument. I checked the URI it produced and it 
is character for character the same as the one produced by the Data Feed Query 
Explorer except that the arguments are in a different order.

However, that isn't the issue either because I tried to copy and paste the URI 
the DFQE uses and make my program use that instead, to no avail.

I've attached the xml that I get back when sending the above query, maybe it'll 
help narrow down the problem? It's formatted with extra space for readability.

Original comment by wearesch...@gmail.com on 1 Jul 2010 at 4:37

Attachments:

GoogleCodeExporter commented 9 years ago
I'm also experiencing this issue, the segment is simply ignored - even when 
copying the URI the DataFeedQuery uses.

Original comment by davidpau...@gmail.com on 10 Aug 2010 at 1:35

GoogleCodeExporter commented 9 years ago
do you mind attaching the code you are using that is not working? Again, I'm 
unable to replicate. Our library has both Service and Client objects. V2, where 
we added support for advanced segments, only works with the Client object 
(which is v2).

Original comment by n...@google.com on 15 Nov 2010 at 7:46

GoogleCodeExporter commented 9 years ago
I had the same issue and solved it by using v=2 at the end of the URL

Original comment by Jaredsne...@gmail.com on 6 Jan 2011 at 5:56

GoogleCodeExporter commented 9 years ago
I can confirm that v=2 also helped me.

Original comment by david.de...@gmail.com on 6 Jan 2011 at 9:15

GoogleCodeExporter commented 9 years ago
Thank you, yours Confirm for me, for the help

Original comment by koi.klun...@gmail.com on 13 Feb 2011 at 3:43

GoogleCodeExporter commented 9 years ago
Removing an obsolete label that was used when these issues were in the 
gdata-issues project.

Original comment by jrobbins@google.com on 21 Jul 2011 at 10:04

GoogleCodeExporter commented 9 years ago
Yeah, v=2 does the trick. Looks like the Data Feed Query Explorer appends that 
behind the scenes, but the URI it spits out for copying doesn't have it.

Original comment by coreylo...@gmail.com on 3 Nov 2011 at 1:23