Profile cover photo
Profile photo
Caleb Whitmore
1,254 followers -
Entrepreneur, Digital Analytics geek, CEO of Analytics Pros
Entrepreneur, Digital Analytics geek, CEO of Analytics Pros

1,254 followers
About
Caleb's posts

Post has attachment
+Luka Cempre does it again - using the +Google Analytics API in awesome ways, part 1: overview and management API: http://goo.gl/V2dh9r

Post has attachment
Proud of my team for coming up with awesome solutions like this!  Thanks +Dan Rowe for the great post!

Post has shared content
Carmen,

I've seen some bizarre data with the new segmentation tool but I don't distrust it. The rules operate differently and it's less clear since they "improved" the UI to make it easier for more people to use.

Rather than using multiple conditions, try combining in your regex in a single condition. That may reduce the ambiguity on the segment.

Caleb
I've found an inconsistency when I segment via the API which I cannot find an explanation for. I'm wondering if it's a side effect of the new segmentation features.

Before I start, please do me a favour, query this segment for your own site in the GA Data Feed Explorer http://ga-dev-tools.appspot.com/explorer/:

dynamic::ga:pagePath==/;ga:pagePath!=/

(add Visits as the metric)

This tells the API to return all the visits that both include AND exclude the homepage -- an impossibility. This query should return 0 visits. Yet I'm getting more than 0 (tried different sites). Please tell me what numbers you are getting.

Now, my problem:
I create 3 segments (all with regex match, below is the API expression):

Visits with Checkout Step 2:
ga:pagePath=~/checkout/step2
Returns: 58 visits

Visits with Checkout Step 2 AND Step 3:
ga:pagePath=~^/checkout/step2;ga:pagePath=~^/checkout/step3
Returns: 50 visits

Visits with Checkout Step 2 BUT NOT Step 3:
ga:pagePath=~^/checkout/step2;ga:pagePath!~^/checkout/step3
Returns: 58 visits even though it should only return  8 visits

The relationship between them should be:

Visits with Checkout Step 2 = 
Visits with Checkout Step 2 AND Step 3 + Visits with Checkout Step 2 BUT NOT Step 3

(the last 2 segments are mutually exclusive subsets of Visits with Checkout Step 2)

My problem is that I see no logical reason why Visits with Step 2 BUT NOT Step 3 should return 58 visits. It's almost as if the DOES NOT MATCH portion of my segment expression gets ignored.

Before the new segmentation feature was rolled out you simply added negative conditions to your segment in order to exclude visits that met a criteria. But now we have the ability to choose Include/Exclude AS WELL AS the ability to add conditions that don't match a criteria.

Let's take 2 examples:

Segment A created using 1 filter:
http://clearclu.es/1bJ0h0H

(Used Visits "Include" with one negative and one positive condition)

This should show me all visits with Step 2 BUT NOT Step 3

This segment expression according to Management API:
ga:pagePath!~^/checkout/step3;ga:pagePath=~^/checkout/step2 (seems correct)

Segment B created using 2 filters:
http://clearclu.es/1b0AOLG

(Used Visits "Include" AND "Exclude" with only positive conditions)

This should also show me all visits with Step 2 BUT NOT Step 3.

This segment expression according to Management API:
ga:pagePath=~^/checkout/step2;ga:pagePath=~^/checkout/step3
(incorrect, it's 2 positive conditions joined by AND even though in UI I clearly specified "exclude")



Unless it's so late in the evening that I'm missing something, the 2 segments should be equivalent. But they're not, and according to the Management API expression they are clearly not.
http://clearclu.es/1bJ4r8T

Segment B (2 filters with only positive conditions) returns the correct number of visits (8 visits). Segment A doesn't, it returns 58 visits (the negative condition seems to be ignored despite the AND).

http://clearclu.es/1bJ0WPG

Interestingly enough though, if I query Segment B by its gaid using the API, I get the correct result (8 visits). This must be what GA use in the UI.

Now, I understand that the new segmentation features won't be available in the API for some time but I would still expect to be able to segment visits the "old fashioned way" via the API and be able to trust the numbers.  I'm building an app based on the API and needless to say, this is a rather big issue.

Thoughts? Have I missed something glaringly obvious? Can you replicate the problem?

+Clancy Childs , +Caleb Whitmore , +Julien Coquet , +Stephane Hamel 
Photo

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment
Wait while more posts are being loaded