Group visitors into segments (classic)

Analytics classic

Segmentation is a method to obtain a selected portion of your analytics data rather than the all of your aggregated data. It is used to create groups of visitors from different locations, specific device users, or visitors who interact with your website / application in a particular way. You can generate reports for selected visitors according to custom criteria.

Set up a segment

To build a segment, follow these steps:

  1. Go to Menu > Analytics.
  2. Click on the All Visits tab, then click Add New Segment.
  3. Name the segment.
  4. From the left-hand menu choose the metric or dimension for the segment’s condition (for example Page URL).
  5. Tip: If you are familiar with metrics and dimensions, you can use the search box to find them.

  6. Drag and drop the element you’ve chosen, select the condition, and input the value.
  7. If you want to set more conditions, add them one by one, by selecting an AND or OR logic operator.
  8. If you want to share the segment with your teammates, select All Users from the upper drop-down menu. Note, that only Owner and User with Admin permission can share segments.
  9. If you want to apply the segment for all websites, select All Websites from the upper drop-down menu.
  10. When you’re done, click Save & Apply.

From now on, your segment will be filtering data and you’ll be able to see segmented data in all reports. Anytime you want to see a segment click the All Visits tab and select the segment you like. On the contrary, if you’re analyzing a segment, and want to see all visits, click the Segment tab and select All Visits.

Segments don’t work for historical data, so it’s best if you create them in the very beginning of your analysis. However, if you build segments later, remember that the data will be only for the period starting after segment creation.

Share segments

Only a user with admin status can share segments with other users with access to the website. Shared segments are visible to other users in the segment menu within the Shared with you section.

Export an email report for a segment

Email Reports are a great way to share reports with your team, executives or clients. You can generate Email Reports for a segment of your choice or for all visitors.

Click your username, in the top right corner, and go to the Analytics Settings (1) of your account and choose Email Reports (2) in a side menu. Click Create and Schedule a report (3).

You will see an Email Report creator. You can determine description, format, frequency and other options. This is where you can choose a segment for which you want to create the report.

Compare segments

For clear data visualisation, we strongly recommend using the Comparison Dashboard feature to compare performance across segments. After installing the Comparison Dashboard (available for all Piwik PRO users), refer to the Comparison -> Compare Segments menu and choose two or three segments you’d like to compare.

With the Funnel Analytics feature you can also compare funnels for each segment. To do so, go to the Compare Segments section and select a Funnel in the menu bar.

Custom segments in the API

In Piwik PRO you can manage custom segments using the following API methods:

  • SegmentEditor.get – Returns a single stored segment by ID
  • SegmentEditor.getAll – Returns all stored segments
  • SegmentEditor.add – Adds a new stored segment Query Parameters:
  • SegmentEditor.update – Modifies an existing stored segment
  • SegmentEditor.delete – Deletes a custom segment
  • API.getSuggestedValuesForSegment – Returns a set of values for a particular segment criteria (such as location and device, etc.)

Examples of segments

Your website is not translated into German and your products are not popular in German-speaking countries. Therefore, when running a campaign you decide not to target those locations.

Segment: Visitors located in Europe, but from countries other than Germany who have converted at least 1 goal. To make this work, a marketer needs to use a tagged URL which may look like this:

2. You are a local retailer selling furniture. You’d like to find out how many visitors come from search engines in your city.

Segment: Visits from Poland, Wrocław, who entered your website through a search engine as organic traffic.

3. You’re trying to optimize your ecommerce store so more users make a purchase. You’re looking for users who added a product to their cart, but didn’t make it to the checkout.

Segment: Visitors who added a product to their carts (goal number 1), but didn’t convert to become buying customers (goal 2).


When should you use segmentation instead of aggregated data?

Aggregated data gives you a very brief overview of your website performance. You cannot make any decisions based solely on unsegmented reports, and you should always look for the right context. With segmentation you can understand which user groups are the most valuable to your business and where you should allocate your marketing spend.

How many segments can I create in Piwik PRO?

You can create an unlimited number of segments. Please keep in mind that a larger number of segments may overload your server, reduce your platform’s performance and extend the archiving process.

Should I test segmentation on a Staging Server?

You should test your segmentation to ensure that the defined segments meet your requirements. Before any production scripts can start calculating segments for larger volumes of data, you need to confirm that the defined segment delivers exactly the results you expect.

Was this article helpful?

Technical Support

If you have any questions, drop us a line at

We’re happy to help!