📘 This article explains how to create segments to set up your project segmentation in Botify.
Overview
After planning your project segmentation, you can begin defining segments in the Segment Editor. Access the Segment Editor from the global navigation bar:
You can also access the Segment Editor through the segment selector at the top of Botify reports by clicking the Edit Segmentation link:
Segment Limits
Your segmentation can include up to 20 segments, with a limit of 3,000 lines across all segments.
Working in the Segment Editor
The Segment Editor includes the following components:
1 - Segment Rules Editor: Where you define your segments.
2 - Checker: Where you test your rules.
3 - History: Previous segmentation configurations to which you can revert.
4 - Segments Preview: Where a sample of results displays when you initiate a test in the checker.
💡 Unsaved changes are identified by an orange dot at the top right of the Segment Rules Editor. Changes are only saved after clicking the Save this configuration as active button at the bottom of the page.
Defining a Segment
The following is the procedure for defining a single segment in the Segment Editor. Refer to the Segmentation Syntax Reference with this procedure and the example below for a comprehensive view of building a full project segmentation.
To define a segment in the Segment Rules Editor:
Identify the segment's name using the following format: [segment:segmentname], replacing segmentname with a name to identify the segment uniquely. This will be the name that identifies the segment group in the Segment filter:
Leave at least one blank line, then identify the first segment name using the following format: @segmentvalue. This will be the name that identifies the segment value in the Segment filter:
On the next line, identify the first condition to be matched for a URL to be included in the segment, using the following format: selector+URL pattern (e.g., path */page/). Refer to the Segmentation Syntax Reference for a list of selectors.
Optionally identify additional conditions for the segment, keeping in mind the order of rules is crucial.
When complete, validate the results are as expected. Note that syntax errors are identified immediately in the Segment Rules Editor with an X next to the erroneous line:
Click Save this configuration as active at the bottom of the page to save the new segment.
Checking Segment Results
You can test your segment rules on a sample of URLs from a previous report or upload a list of URLs to test if this is your first report. Botify will show the list of URLs and the segment they were placed in. You can navigate the results using the result tree on the right:
You can check your segment rules against URLs from the following sources:
Existing reports in the same project.
URLs found in Botify LogAnalyzer data.
A list of URLs you paste into the Segment Editor.
To test segment rules:
In the Checker’s URLs Dataset field, select the URL source. Botify analysis reports are at the top of the list, followed by LogAnalyzer reports, then the manual option:
In the Number of URLs field, select the number of URLs to test.
Optionally select a sample percentage less than 100%.
Optionally identify a filter to select URLs that include or exclude a particular pattern. This can be helpful when testing complex rules against a large dataset.
Click Check.
Exploring Segment Results
All URLs in the sample are displayed in the Segments Preview panel, including in which segments they were grouped and whether they have a "warning" flag. URLs classified as #nomatch are not placed in any segment because they do not match any defined segment rule. The URL count for each segment is displayed in the column on the right.
Filtering Results
Click segment value names in the column on the right to filter the result list. A filter for "warning" URLs is also available. When a filter is applied, the segment name is highlighted in blue. Click the segment again to remove the filter, or click the Remove Filters button at the bottom to remove all applied filters.
If you defined subsegments (segment children), click the total next to the parent segment to explore the full content of the segment, including subsegments. In the following example of a sports forum, subsegments define posting categories. Clicking the “157” total next to the forum segment enables you to explore the full content of the forum segment, including the subsegments:
To explore only the forum pages without subsegments, click on the count for the parent segment - here, "(6)":
Segment Example
This segment is defined for an e-commerce website that sells products and has a marketplace for other sellers, using three simple segment values:
Product pages
Category pages
Marketplace pages
Applying these segment rules to a sample of URLs with the following conditions:
URLs Dataset: From the latest analysis
Number of URLs: 5,000 URLs (maximum size)
Sample: 100%
URL Filtering: None (no URL selection for the sample)
returns the following results:
The preview panel shows the count for each segment on the right and the number of URLs not placed in any segment (#nomatch). You can browse the segment's content (click in the list on the right) and #nomatch URLs to decide which segments to add and/or how to refine existing segments:
Refining Results
To refine your segmentation, test segment rules again against specific samples or exclude URLs once you have validated some segments. For example, test only product URLs using the following filter:
to get these results:
You can then run another test that excludes all product pages using the following filter:
Notice the results include product pages with tracking parameters, which are duplicates you typically want to isolate from the main version of product pages. Refine your results further by creating a product subsegment identified as a warning. You can also create the same for your category and search results pages.
Also, notice the home page is included in the #nomatch pages. Since the home page cannot be compared to any other page in terms of traffic, it makes sense to create a segment just for the home page, with a subsegment for duplicates, when importing organic and social visits data from Google Analytics:
Now that you have segments for category and search pages group them into a higher-level segment that contains all navigation pages:
Testing this more detailed segmentation produces the following results:
Segments and subsegments are shown in the segments tree on the right, and warning segments are identified separately. You can browse a segment with its subsegments, as below, and their duplicates (click on the total count between parentheses):
Or, just categories, excluding the duplicates subsegment:
Using Other Segmentation Versions
Botify maintains project segmentation history by the date when the segmentation was saved. This enables you to revert to previous versions and apply new ones to existing reports. Versions are in the Segment Editor’s History list, with the current version at the top, identified as “Active”.
Select a previous version in the list to revert to it, then click Save this configuration as active:
The segmentation version currently applied is identified at the top of Botify reports:
When you save a new version, you are prompted to apply it to any previous analysis retroactively. To apply segments to existing reports, select the reports you want to apply the new segmentation to, then click Apply:
You can also apply new segmentation retroactively from the notification in the Segments filter in Botify reports:
The following identifies the segmentation as being actively recomputed:
When the segmentation is successfully applied, click the refresh icon in the Segments filter to see the changes reflected in the report:
See also: