Choose between Include and Exclude filters to segment a report in Google Analytics

Just like there’s a fine line between ‘friendzoned’ and ‘she likes me’, there’s a fine line between the ‘Exclude + contains’ and ‘Include + does not contain’ filters used to segment reports. Just like you believe she likes you but you’re actually friendzoned, you believe you’ve put the right filters and are receiving the right data, but you actually aren’t! Thank me later.

 

 

Let me present you with an example – Given a global e-commerce website, let’s say we wanna view a sessions report in Google Analytics, segmented in terms of location. The segment is supposed to display data excluding a particular country, say China. Which filter shall we use? Shall we go for ‘Exclude sessions that contain China’ or ‘Include sessions that do not contain China’?

Let’s say we use the latter, i.e., Include. We expect the output to be a segment that doesn’t contain data from China.

To test the decision we just made, let me introduce you to Marco, who is our user from Italy. Assume that Marco visits our website, thereby beginning a session. He spends some time exploring it (sending interaction hits), our website being the Italian version, of course. But this curious chap, decides to check out the Chinese version of our website. He switches his country from Italy to China using the location dropdown menu, spends time exploring our Chinese website, and exits, thereby concluding his session.

Does Marco’s session appear in our segment? His session contains Chinese data, and thus it must not appear in our report segment. But bro, it does.

A session comprises multiple hits. Each hit during a session undergoes the filters we’ve applied to our Google Analytics report, and the session seeps into our report if any of the hits match our conditions. Each hit of Marco’s session undergoes the filter Include if session does not contain China. And so, when his Italian hits undergo the filter, they match the condition and the session lands straight onto our report. His Chinese hits discard the session, but his Italian hits include the session into our segment.

And thus, to completely exclude Chinese sessions, we must’ve used the Exclude filter. Quite similarly and quite often, it gets a bit tricky to decide the right filter. Here are a few case studies to help you clarify the blurred picture!

Case Study I – View Order Confirmation data for all countries excluding Norway

So we wish to create a segment on Google Analytics, which shows order confirmation data for all countries except Norway. To achieve this, open any report on your Google Analytics dashboard and start creating a segment. To create a segment,

  1. Click on Add Segment > New Segment > Conditions (Under Advanced).
  2. Give a name to your segment and choose ‘sessions’ from the drop-down next to Filter and ‘Exclude’ from the next drop-down.

Since we only want to view the sessions of users who placed orders successfully, it’s a great idea to extract sessions that contain the page that comes immediately after the order has been placed, most popularly known as the Thank-you page.

So the conditions that we set while creating our segment look like this –

Page Contains – [pagepath of your thank-you page]

AND

Page does not contain – [pagepath specifying the country to be excluded]


Case Study II – 

Sometimes we wanna look at the behavior of our guests (visitors who don’t sign up/log in). To exclude the data of logged in users, we need to create a variable in Google Tag Manager and pass it to Google Analytics as a custom dimension. Let’s say we call our custom dimension ‘loggedinstatus’ which can have the values ‘logged in’ and ‘guest’ depending upon the status of our visitor.

To exclude the sessions of logged in visitors, start by creating a segment.

  1. Open an All Pages report in Google Analytics and click on ‘Add Segment’.
  2. Select New Segment and choose ‘Conditions’ under ‘Advanced’ from the left panel.
  3. Name your segment accordingly and choose Exclude from the dropdown.
  4. Start by entering the conditions. To exclude sessions of logged in users, our custom dimension, which we just named loggedinstatus, must contain the value ‘logged in’. Specify more conditions to view a more specific report, just like we retrieved successful order placement sessions for Case Study – I.
  5. Save your segment.

Summing it up, the confusion between Include and Exclude creeps in when a single session may be a combination of different versions of a website. In the examples above, one session was a combination of Italian and Chinese versions of our website, whereas in another, a user interacted as a guest and later logged in, thereby accessing both the versions. This makes it tricky to segment reports accurately, but now you know what to do!

How we can help

Very often, even the biggest of companies keep receiving inaccurate Analytics data, and they have no clue what’s wrong! Some companies don’t even realize they’re working with erroneous data. Retrieving accurate reports is a technical art. And that’s what we excel in. We are a crazy team of Google and Adobe Certified Analytics Experts who eat, breathe, sleep and dream Analytics. And we’ve made it our purpose and passion to electrify your business’s potential through Analytics.

Contact us here.

Found it informative? Leave a comment! You can also give us a thumbs up by sharing it with your community. Also did you know that you can light up our day by subscribing to our blog? Subscribe here –


Leave a Reply

Your email address will not be published. Required fields are marked *