About Segments in Matomo
The Segments functionality in Matomo enables you to view and analyse reports on smaller groups of your audience, based on specific criteria like their country or whether they bought something. Even though it is useful to collect data about every website visitor, sometimes you want to learn more about a certain type of website visitor.
The criteria to define these segments is based on the data collected within your analytics. Below you’ll find some some common themes that can be used to create segments:
- Visit Based Segments – You can create segments based on people’s visit patterns. Do first time visitors exhibit different traits to returning visitors? Or perhaps people that arrive on specific landing pages experience your site differently to those landing on your blog?
- Interaction Based Segments – If you have configured Events or Goals on your website, you can create segments to differentiate the traffic of those who have completed certain actions, or not. This might help you reveal wider trends for visitors that complete desired actions.
- Campaign Based Segments – Go beyond tracking the number of visits from your marketing campaigns. Gain deeper insights into the differing usage patterns of people arriving to your site from specific traffic sources, or advertising campaigns.
- Ecommerce Segments – You could create customer segments to separate the traffic of those who made a purchase vs those who didn’t. You can even get really specific and compare the visits associated with purchasers of a specific product. The data may reveal different types of customers with unique browsing patterns.
- Demographic Segments – It is possible to build segments based on the language of a user’s browser, or the location of their IP address, or any other custom dimension. While this may have some privacy implications, it can help you understand how these aspects impact what people do on your website.
- Technographic Segments – The experience on your website can vary greatly depending on the device, or even the web browser, someone uses to access your site. Creating segments based on the technology a customer is using might reveal issues for certain platforms, or even different attitudes between users.
Hopefully you are starting to see the potential power of looking at smaller groups of your audience data. You can learn insights from segment analysis that might not be seen when looking at the combined data of every type of person visiting your site.
How to Build Custom Segments in Matomo
1. Open the Segment Editor
To create a new Segment within the Matomo dashboard, you need to click on the button labelled All Visits in the data selector section shown below. The text label for this button is always set to the current segment, which in this case includes all visitors to the site.
Clicking the segment selector opens a dropdown menu which gives the list of available Segments, including the default All visits, plus any custom segments shared with you or that you’ve created. To start building a new segment, click the big green Add New Segment button which will load the Segment editor.
2. Segment Configuration
Within the Segment Editor, you will notice a small line of text along the top with dropdowns indicated by green arrows. The first dropdown lets you toggle between creating a new segment or editing an existing one. The remaining dropdowns show segment configuration settings with the current settings in bold. You can edit each setting by clicking the green dropdown arrow to its right. In most cases you won’t need to edit these, but it is useful to know what they do and where to find them.
Sharing a segment with all users
By default, any segment created by a user is only viewable by the user who created it, as well as by all Super Users. When creating a segment, at the top of the Segment Editor it says by default “This segment is visible to me”. You can choose to share the segment with “All Users” by selecting “This segment is visible to all users”. A segment shared with all users will appear in the list of segments for all users when they view their Matomo reports. Note: sharing a segment with all users is only accessible to Super Users.
Reusing segments across other websites
By default, a segment is created on a specific website (the current website you are viewing). When editing the segment, at the top of the segment editor it says “This segment is processed for this website only”. You can choose to share the segment across all websites by selecting “This segment is processed across all websites”. When you share a segment across all websites, the segment will appear in the list of segments on all websites. Note: sharing a segment with all users is only accessible to Super Users.
Improve the performance of your site while using Segments.
Last but not least, you will see an option to decide whether segments are processed in real-time or pre-processed (which requires a cron job). The latter option will only be present if you are using a self-hosted version of Matomo as it requires server access. This feature is especially useful if your site has a lot of traffic as the default “real-time” option may lead to slow loading reports.
3. Defining Your Segment
Next, you can begin creating the segment definition itself using the editor shown below. Begin by adding a clear and descriptive Name that you will use to identify your segment. For example, Customers or Returning Visitors as shown below.
To define exactly what group of visitors will appear within the segment, you will need to build a filter based on elements of your collected user and visit data. You can even combine more than one filter with a logical OR / AND flow.
You can review the available criteria that can be used to define a segment by clicking on the initial dropdown field on the first row. You can identify this field as it will state Actions in Visit by default, however, clicking it will bring up the following list in a box.
There are too many options available to cover in this article, so you should spend some time exploring the list of segment filters to discover them all. If you already know exactly what you want to filter by, you can use the search box to find the relevant user or visit data. You can also see a list of all segment filters available here.
Once you’ve selected a dimension to segment, for example; Visit Location > Country or Visitors > Visit type, you need to set the filtering criteria. You may notice a small question mark next to many of the filtering criteria. Hovering over these icons will display a full description of the relevant matching criteria.
As an example, if you wanted to create a Returning Visitors from UK segment. First you’d set the first dropdown to Visit type, the second to Is and the final text box to returning. Next, you would click + Add AND condition to combine filtering options.
Within the new section; select Visit Location > Country for the first dropdown, then Is for the second and finally United Kingdom in the text box as shown below.
When you begin typing a value in one of the text boxes for the filtering criteria, Matomo will suggest available options from the data set. You can click on these suggestions where possible to ensure the correct formatting and avoid potential typos.
After you have finished building your filter criteria, you can press the TEST button to bring up a log of all visits matching your Segment. If the details look correct, you can close the visits log popup and hit the green Save & Apply button at the bottom of the Segment editor.
Working with Segments
How to Apply an Existing Segment to Your Data
Once you’ve created a custom segment, you can begin using it in any of the standard Matomo reporting views. Visit the section you’d like to review and then click the Segment button in the top menu to bring up the list of segments. As a reminder, the segment button always shows the name of the currently active segment, e.g. All Visits by default.
Clicking on a segment name will update the view to reflect data relating to your chosen segment. When viewing a report, you can always check which, if any, segment is applied by referencing the bold label of the segment button.
How to Edit and Delete Your Segments
Click on the Segment button in the top menu to bring up the list of available segments. Then click on the pencil button to the right of the relevant name to load the segment editor. Now you can update your segment details and click the big green Save & Apply button, or click the red Delete text link to remove your segment.
Using segments in e-mail reports
It is also possible to create e-mail reports that use a segment:
E-mail reports that use a segment will display the segment name at the top of the page.
How to Decide Which Segments Are Important For Your Site
While some segments are likely to be useful for the majority of sites (examples provided below), some segments will only be relevant to yours. For example, if you have an affiliate or partner relationship with another company, you may want to look at visits which click on your partner links. Or, if you use special content features, such as AMP from Google, then you may want to create a segment based on the URL pattern of those visitors.
Common Segments, Their Use Cases and How to Create Them
Below you’ll find a selection of popular segments to help you get started. Each segment comes with instructions for defining them and also some examples of the types of questions they might be able to help you answer.
Visit Ecommerce status at the end of the visit is ordered OR Visit Ecommerce status at the end of the visit is orderedThenAbandonedCart
Questions to ask…
What content was most helpful at driving your sales?
This could reveal effective pages or lead sources you should aim to drive extra traffic to, or high converting pages you may want to replicate for other sections.
Did your customers watch product videos before purchasing?
This can help you evaluate whether your product media is increasing conversions. You might be surprised by which media assets perform better than others with only small differences in production.
Are customers reading reviews?
Reviews can be an important factor when people are considering an online purchase. This segment could help you discover whether people are reading your reviews or not.
Segment: Returning Customers
Visit Ecommerce status at the end of the visit Is ordered AND Number of Visits Greater than 1
Questions to ask…
Did returning customers find the product they initially searched for?
If this is something you offer, have they found it and made a purchase? Or is it something you don’t offer, but everyone is looking for? Perhaps it is something your business could consider adding to its product selection.
Do returning customers navigate your site differently to new users?
You might discover that a long-form sales approach works for new customers, but not returning customers. Or you may be pushing returning customers into repeating unnecessary onboarding steps.
Segment: Bounced Visits
Number of Interactions Equals 1
Questions to ask…
What pages are these visitors landing on?
You could discover that almost everyone who lands on your homepage immediately leaves. This might suggest it is time to update your homepage with a new design. Or, if you’ve been linking campaigns to your homepage, there may be another higher converting page which is more beneficial to direct people to.
What keywords are they using?
This kind of data can be really useful for optimising your paid search campaigns. Two variations of the same key phrase may generate wildly different conversion rates. Discovering this can help you manage your paid campaign budget for those keywords to achieve the greatest efficiency.
Why do you think those pages didn’t answer their question?
When looking at this report you might notice that a certain paid traffic source leads to an unusually high number of bounced users. You can use this knowledge to negotiate a discount with the supplier or even drop it completely.
Segment: Mobile Visits
Device type Is feature phone OR Device type Is smartphone OR Device type Is phablet OR Device type Is tablet
Questions to ask…
Are mobile visitors spending more or less time engaging with your content?
Often the mobile and desktop experience of a website can be very different even when using a simple responsive design. This can impact the appearance of your content, which in turn can impact how much engagement it gets. The mobile segment can also help flag content that might be hidden for some reason or another on small devices.
Do mobile visitors convert (either sales or leads) at the same level as your desktop users?
While your business objectives may not change, you may discover that mobile visitors convert some goals more than others. This could impact your funnel design and cross-platform strategy.
Segment: Visits from your geographic region
Country Is XX AND Region Is XX
Note: You need to replace XX with your relevant country name and region code (full region code list).
Questions to ask…
What do local visitors do differently than your broader audience?
If you are a local service provider, then local visitors should be your most profitable ones. You will likely want to place more focus on the actions of these users, even if they make up a smaller proportion of your website traffic.
What proportion of your visitors are from your area?
Regional businesses might discover that some traffic sources deliver volume, but no local users. This might suggest you need to refocus your marketing efforts on referrers and sources that deliver local traffic.
Segment: Visits from Search Engines
Channel Type Is search
Questions to ask…
What content is most popular from search?
Working with this segment can help you discover your most (and least) popular content from search. Armed with this information you might spend more time optimising your top search pages for conversion. You might also decide to spend more time on search engine optimisation for low performing pages.
Do people coming from search complete your marketing funnels in the same way, or are they missing crucial information?
Consider where search visitors enter your site, could they be missing vital steps of your sales funnels? Do you have content that is usually hidden behind landing pages, but is actually receiving visits directly from search?
How to Analyse Segments Within Your Reporting
Comparing Segment Data
Sometimes you might want to compare segments of users, looking for differences. To do this, begin by clicking the segment button and selecting one of the segments in the usual fashion. Next, reopen the segment list, but this time click the Comparison Icon .
This will plot the data for the two segments side by side for any report that your segments are compatible with. The example below shows what the comparison looks like in the Acquisition section of Matomo. Active segments are colour-coded and displayed in dismissable cards along the top of the page.
Segmentation API Usage
- How do I find a specific visitor logs by segmenting on Visitor ID?
- How do segments work when segmenting on specific actions (pages or events) and how do I filter out any actions that don’t match?
- Matomo comes with tons of filtering options as standard. With a Matomo Cloud Subscription, or premium plugins for the self-hosted version, you can do even more. Premium features enable you to segment based on media usage, funnel progress and even exposure to A/B tests of your website and its content.