We have two event tracking codes in GA. Suppose they are:

Category: Cat_A, Action: Action_A, Label: Label_A
Category: Cat_B, Action: Action_B, Label: Label_B

I can get total event and unique event for the above tracking. Can anyone help me how can I get in how many session OR for how many users - event A got triggered but not event B and vice-versa, also for how many users/sessions both were triggered?

How can we do such filtering at the user level?


You can do this with segments, for either users or sessions.

If you don't need more than one event dimension to uniquely identify the event (for example, if Label_A and Label_B will never be associated with events except for the Cat_A/Action_A and Cat_B/Action_B events), you can use a condition segment.

Here is setup for the "triggered A but not B" segment. After clicking "Add Segment" at the top of the page and then "New Segment" in the segment selection panel, select Conditions in the sidebar. You'll need two filters: Include Sessions where Event Label exactly matches Label_A, Exclude Sessions where Event Label exactly matches Label_B. Note that these are two distinct filters, not "and/or" within a filter.

Conditions segment builder screenshot

If you need, say, both Action and Label to uniquely identify your events, you'll need a sequence segment - although your sequences will be only one step long. Sequences are the only place I know of where you can specify multiple conditions for the same hit.

In the sequence panel, you'll again have two filters to include event A sessions and exclude event B sessions, but this time you'll use the "and" option within Step 1 of each filter. Set Event Label exactly matching Label_A and Event Action exactly matching Action_A in Step 1 of the "include" filter, and likewise for B in the "exclude" filter.

Sequence segment builder screenshot

To get B but not A, swap the "include" and "exclude" settings; use "exclude" for both filters for sessions in which neither event was triggered, and "include" for both filters for sessions in which both events were triggered. Everywhere it says "sessions" you can change to "users", as well.

Once you've saved one segment, you can copy it (from the Actions drop-down menu on the right-hand side of the segment list). Since the different segments are very similar, that should make creating all of them fairly quick.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.