How to use Segments in Google Analytics: 5 Examples of Quick Insights Using Custom Segments

By Andy Crestodina

There’s a line that separates the Analytics beginners from the Analytics experts.

It’s not an abstract line. It’s an actual physical line in Google Analytics.

It’s the line that separates the menu for the reports (on the left) from the reports themselves (on the right)

google analytics report

Clicking on the left brings you to aggregate data …and not a lot of insights.

Clicking on the right slices up that data …giving you deep and actionable insights.

All the fun stuff is on the right side of that line, including:

  • Drill downs taking you deeper into each report
  • Filters and advanced filters to see subsets of the data
  • Secondary dimensions, letting you combine data from two reports
  • Table display buttons, for comparison charts, pivot tables, etc.
  • Segments, for looking at subsets of users.

That last one is a biggie. Segments are a fast and powerful way to make your reports more accurate and more useful.

This guide will show you how to use Google Analytics segments for better data, better decisions and better digital marketing. We’re going to use five examples of segments:

  1. Remove spam traffic
  2. Remove visitors who log in
  3. See all of your social media traffic
  4. Compare visitors who do (and don’t) watch videos
  5. Compare high-intent and low-intent visitors (blog readers)

1. Use segments to remove spam and bot traffic

What’s that traffic spike? Did we send an email? Did something go viral? Was it a press hit?

No, it’s spam.

When you see a spike in traffic that has the same strange, unexplainable traffic pattern, it’s probably spam. It often looks like one of these:

  • It’s a sudden spike from on traffic source …at a random time.
  • It all comes from the same random country …where you don’t have an audience.
  • It’s a lot of pageviews for the same “page” …but the page isn’t actually a page on your site.

How did the spammers visit a page that didn’t exist? They didn’t. They never actually visited your site. They exploited a weakness in javascript to inject data directly into Google Analytics servers, using your UA code, but without touching your web server.

Here’s what spam traffic looks like in the All Pages report.

spam traffic in google analytics

If you’re not sure which row in the reports explains the spike, the “plot rows” feature can help. Just check the box on the row of the prime suspect and click the “Plot Rows” button above.

spam traffic to exclude

Found the troublemaker? Let’s zap him out of there with a custom segment. Everything you need to do fits in this one screenshot:

spam segment in google analytics

Step 1. Click the + Add Segment button

It’s at the top, above the trendline in every report.

Step 2. Click the + New Segment button

It’s the big red button. Give your segment a name, like “Non-Spam.”

Step 3. Click “Conditions”

We’re going to create an advanced segment using conditions.

Step 4. Set the conditions for your new segment

Segmentation can apply to sessions (visits) or users (visitors). Probably, it makes no difference which you choose. You’ll get very similar insights either way.

Here we tell Analytics to remove the culprit, as in exclude sessions when a page contains the spam URL.

Step 5. Bonus mini-report!

Even before you save the segment, you can see what percentage of your traffic you’re removing.

This is useful for just troubleshooting (did I do this right?). Or for answering fun new questions (what percentage of my social media visitors are on mobile devices and have visited before?) The answer appears even if you don’t save the segment …but don’t forget to save.

Analytics is fixed! All better. Spam traffic removed. Now you can navigate around all your favorite reports knowing that metrics like bounce rates and conversion rates are meaningful again.

traffic without spam

2. Use segments to remove visitors who log in (current customers and users)

For any site with a login button on the homepage (banks, schools, some ecommerce sites, sites with membership access) a lot of visitors are just there to click that button. It’s often 95% of homepage traffic.

But if they click to log in, they’re not potential clients, they’re not prospects, they’re current customers. It would be nice if they weren’t diluting your marketing data.

Here’s how to use a segment to remove “log in” visitors from Google Analytics.

Note: Here we’re going to assume that once logged in, they’re on a different site (different domain and a different Analytics property). In other words, we’re assuming that the login click is an exit click. If the login area is on the same site, perhaps on a subdomain, you would use a different segment.

First, you’ll need to have event tracking set up. Events are ways to track “non-pageview interactions” which don’t load a new page on the website, such as exit clicks.

You can set up event tracking using Google Tag Manager (GTM). Once in place, the tag and trigger will look something like this:

gtm event for user logins

Having trouble? Ask your developer. If they can’t help, Kyle can.

Once it’s set up, you’ll see the clicks recorded in the Behavior > Events > Top Events report. If you used the settings above, the Event Action will be “Sign in” and the Event Label will be “Login Click.”

sign in clicks in the event report

Next, we’ll make a segment to exclude visits that recorded that event. Here are all of the steps involved:

how to segment out logged in users

Step 1. Click the + Add Segment button

It’s above the trendline in every report.

Step 2. Click the + New Segment button

It’s the big red button. Give your segment a clever name, like “Non-Logins.”

Step 3. Click “Conditions”

This is another advanced segment, where we’ll set conditions for a filter.

Step 4. Set the conditions for your new segment

Here we tell Analytics to remove those who clicked the sign in button. Literally, we want it to exclude sessions when the event action contains “Sign in” (or whatever you set as the Event Action in the GTM tag.)

Done! You just removed all the visits from all the visitors who click on the “Sign In” button, taking all of your current customers out of Analytics.

Who’s left? Potential customers interacting with your marketing content.

Now you have a more accurate picture of your homepage bounce rate, your conversion rates, your direct traffic and every other metric diluted by your just-passing-through-to-log-in visitors.

Analytics pro, Angela Lynn, builds segments that combine conditions, so she knows she’s looking at a specific group of users.

Angela Lynn, Sexy Dashboards

You likely have more than one type of client or group of people viewing your website. For example, one of my clients’ websites has two audiences, the teachers and the students. We can get a sense of which users are based on the campaigns that brought them to the site and which content they clicked. With segments, we can layer conditions on top of one another to really narrow in on a certain type of user.”

example of an advanced segment

3. Use segments to check social media traffic

Social media traffic comes from many networks. It comes from browsers and apps. It’s from your accounts and others’ accounts.

This makes it hard for Analytics to catch it all and group it together. Visitors from social sources often get recorded as referral traffic or direct traffic.

But a segment will catch them all. Here’s how to use segments to see social media traffic in Google Analytics:

setting up segments for social media traffic

Step 1. Click the + Add Segment button

Step 2. Click the + New Segment button

We need to create one of our own because there is no predefined segment for social media traffic in Google Analytics. So click the big red button. Give your segment a nice name, like “Social media visitors”

Step 3. Click “Conditions”

Step 4. Set the conditions for your new segment

Here we tell Analytics to include sessions when a source matches one of your social networks.

Your segment is for visits where the Source / Medium contains any of your social networks. Copy and paste this long RegEx string into the open field:


Step 5. Bonus mini-report!

Even before you save the segment, you can see what percentage of your traffic you’re removing. In the example above, Analytics shows that 3.38% of visitors come from social media.

Done! Now you’re just looking at traffic from social media visitors. It’s interesting, especially if you leave the “All Users” segment turned on. This lets you compare social visitors to all visitors.

Check out the conversion reports. Or the Behavior > Overview report. Or the Audience > Mobile > Overview report.

example of social media visits on a mobile device

This isn’t the only way to track social visitors. See our complete guide for tracking social media traffic.

4. Use segments to measure the effectiveness of video

The visitor clicks the play button! Did Analytics track that click? Not unless event tracking is set up. That’s because video play button clicks are non-pageview interactions, just like the exit clicks we mentioned above.

But with an event set up in Google Tag Manager, and a segment set up in Google Analytics, you see if the video was played. But you can also see how video impacts engagement. You can answer the big question: Does video help convert visitors?

First, you’ll need to set up the event. Here are the step-by-step video instructions. When you’re done, the tag and trigger will look something like this:

event tracking for youtube videos

If you’re setting this up for the first time, you’ll need to wait a few weeks for the data to accrue before you can do much analysis. When you’re ready, here’s how to set up the segment:

segment for youtube videos

Step 1. Click the + Add Segment button

Step 2. Click the + New Segment button

Click the big red button. Give your segment a nice name, like “Video Watchers”

Step 3. Click “Conditions”

As before, this is an advanced segment, which is at the bottom of the menu in the segment builder

Step 4. Set the conditions for your new segment

Here we tell Analytics to just show visits when the event was triggered. Specifically, we want it to include sessions when the event category contains “Video view” (or whatever you set as the Event Category in the GTM tag.)

Step 5. Repeat, but this time exclude video watchers

To measure video performance, we need to compare the watchers with the non-watchers. So we’ll need a second segment. Follow the same steps but name this one “Video Non-Watchers” and this time exclude sessions that contained the “Video view” Event Category.

Done! Now the reports in Analytics will show you the two types of visitors with two sets of metrics in each report. Navigate to a page that has video from the Behavior > Site Content > All Pages report and you can compare the behavior and conversion metrics of the two audiences.

Check the impact that video has on engagement metrics. It will look something like this:

example video view reports in google analytics

In this example, visitors who watch the video are 20% less likely to bounce, they spend 3.5x as much time on the page and they are 3.5x more likely to take an action.

We’ve answered the question “how does video impact visitor engagement?”

5. Use segments to separate high-intent from low-intent visitors

There are two kinds of website visitors:

  1. Some visitors are looking for a service. They start their visits on sales pages, often because they searched for commercial-intent phrases.
  2. Some visitors are just looking for answers. They start their visits on articles, often because they searched for information-intent phrases.

But naturally, Analytics doesn’t separate them for you. This means that the more traffic you attract to your articles, the more your conversion rates fall.

Every high-ranking article, every press hit and every viral headline push down conversion rates and push up bounce rates.

But if you make a segment to measure these two types of visitors separately, Analytics becomes more meaningful and useful. You need to set up two very simple segments, each based on the landing page, as in the first page in the visit.

Here’s how:

segment for people who only visit the blog

Step 1. Click the + Add Segment button

It’s at the top, above the trendline in every report.

Step 2. Click the + New Segment button

Click the big red button. Give your segment a nice name, like “Blog Landers”

Step 3. Click “Conditions”

It’s in the left side menu, under “Advanced.”

Step 4. Set the conditions for your new segment

Next, we tell Analytics to just show visits that began on a blog post. Specifically, we want to include sessions when the Landing Page contains “blog”

Note: This assumes that all of your blog content is in a directory, such as This makes analysis easy. This is still possible if the blog content is in a subdomain, such as, but that requires you set up subdomain tracking first. If you blog on another domain (Medium, LinkedIn, etc.) this cannot be tracked in your Analytics. This is one of many strategic considerations for deciding where to blog.

Step 5. Repeat, but this time for visitors who didn’t land on the blog.

The second segment is the same, but excludes the “Blog Landers”. I call mine “Service Page Landers.” Follow the same steps but this time include sessions when the landing page does not contain “blog”

Done! Now you can see the differences in conversion rate side-by-side. The lead generation sections of the sites can be assessed accurately. Conversion-focused improvements can be measured.

website engagement comparison report

Now you’re ready to test some UX, CTA and conversion copy improvements!

Bonus! Share your new segments

Now, pass it along to other people who access Google Analytics using different accounts. If they didn’t log in using the same email address, they can’t see it unless you share it.

In the admin section, at the very bottom of the “View” menu, there’s a “Share Assets” button. Click it and then find your segment. Select one (or multiple segments) and click share. Analytics will give you a link that you can send to anyone. When they click it, they can choose to add it to any view in any account they have access to.

how to share segments

From here, you can also share (or delete) other assets such as dashboards, custom reports, attribution models, etc.

Creating segments for context …and for better meetings

I’m sad to say that I used Google Analytics for nearly 10 years before clicking on the + Add Segment button. It just always seemed complicated. I’d heard it was useful, but it never seemed like I needed it at the time.

I did a lot of report customization using filters and secondary dimensions, but those are just specific to that report. If you click to see another report, your filters are gone. But a segment sticks around as you navigate all of your reports!

Note! Google Search Console reports don’t obey segments. They’re all pre-click data from organic search. They track searches and clicks within the search engine, not visits and visitors to your website. So there are no visitors to segment.

These days, I almost always have a segment turned on. It just takes a few clicks and it gives the report context. It gives everyone confidence that we’re looking at meaningful data.

“Average numbers are for average marketers.” – Jeff Coyle, Market Muse

“All data in aggregate is crap.” – Avinash Kaushik, Occam’s Razor

So don’t just navigate between reports in the menu on the left. Those big aggregate numbers are the least meaningful. Set up a segment. Click on the right!

There is more where this came from…

The best articles from this blog are available all in one place – our book. Now on it’s 6th edition.

Content Chemistry, The Illustrated Handbook for Content Marketing, is packed with practical tips, real-world examples, and expert insights. A must-read for anyone looking to build a content strategy that drives real business impact. Check out the reviews on Amazon.

Buy now direct $29.95