Steve Eastwood
Steve Eastwood

Reputation: 1803

Analytics API: How to define a segment by using event category AND event action

Question

Is is possible to create a segment (not a filter) which contains only Session1 and not Session2.

Situation

## Event Defintion
          Category  Action
Event A   CatX      ActX
Event B   CatX      ActY
Event C   CatY      ActX

## accured sessions
Session1: Event A is fired
Session2: Event B is fired AND Event C is fired

Attemps

sessions::condition::ga:eventCategory==CatX;ga:eventAction==ActX Would return both of the session. For session1 event A would fulfill both conditions. In Session2 Event B would fulfill the first condition and Event C would fulfill the second.

Idea

sessions::condition::(ga:eventCategory==CatX;ga:eventAction==ActX) The () shall express, that one event has to match both of the conditions. I have never seen an example working with parantethis. Is this somehow possibel? If so could you share an example?

Thanks a lot for the support!

Upvotes: 1

Views: 767

Answers (1)

Max Ostapenko
Max Ostapenko

Reputation: 546

try using Sequence Conditions for your task.

SESSION1:

sessions::sequence::ga:eventCategory==X;ga:eventAction==X

SESSION2:

sessions::sequence::ga:eventCategory==X;ga:eventAction==Y;->>ga:eventCategory==Y;ga:eventAction==X

plus

sessions::sequence::ga:eventCategory==Y;ga:eventAction==X;->>ga:eventCategory==X;ga:eventAction==Y

Upvotes: 2

Related Questions