Skip to main content

Creating Segments

Updated over a year ago

📘 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:

segments_editor.png

You can also access the Segment Editor through the segment selector at the top of Botify reports by clicking the Edit Segmentation link:

segments_edit.png

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.

segments_editorsections.png

💡 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.

segments_unsaved.png

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:

  1. 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:

    segmentsfilter.png

  2. 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:

    segment_values.png

  3. 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.

  4. Optionally identify additional conditions for the segment, keeping in mind the order of rules is crucial.

  5. 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:

    segments_error.png
  6. 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:

segments_exampleresult.png

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:

  1. 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:

    segments_datasets.png

  2. In the Number of URLs field, select the number of URLs to test.

  3. Optionally select a sample percentage less than 100%.

  4. 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.

  5. Click Check.

    segments_checker.png

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.

segments_preview2.png

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.

segments_filterresults.png

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:

segments_fullfilter.png

To explore only the forum pages without subsegments, click on the count for the parent segment - here, "(6)":

segments_subsegmentfilter.png

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

segment_example1.png

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)

segments_checker2.png

returns the following results:

segments_resultsex.png

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:

segments_selected.png

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:

segments_prodfilter.png

to get these results:

segments_filteredbyprodpage.png

You can then run another test that excludes all product pages using the following filter:

segments_noprodpges.png

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.

segment_subsegwarn.png

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:

segments_home.png

Now that you have segments for category and search pages group them into a higher-level segment that contains all navigation pages:

segments_nav.png

Testing this more detailed segmentation produces the following results:

segments_detailresult.png

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):

segments_catdupsselect.png

Or, just categories, excluding the duplicates subsegment:

segments_catsselected.png

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:

segments_saveconfig.png

The segmentation version currently applied is identified at the top of Botify reports:

segments_version.png

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:

segmentation_retro.png

You can also apply new segmentation retroactively from the notification in the Segments filter in Botify reports:

segments_applynew.png

The following identifies the segmentation as being actively recomputed:

segments_updating.gif

When the segmentation is successfully applied, click the refresh icon in the Segments filter to see the changes reflected in the report:

segments_refresh.png

See also:

Did this answer your question?