Publication segmentation can be used to send targeted messages to specific groups of users. For example, you can show different publications to paying users and non-paying or logged in users and logged out. You can also show different content to users based on behaviors such as past purchases from your store or which specific page they are visiting on your domain.

Segmentation is a seemingly simple but extremely powerful mechanism to filter publications based on your own conditions.

Getting Started

Let's say you have configured a widget on your landing page and another one in your dashboard that only authenticated users see. Now, let's assume you would like to display general announcements in both widgets but some publications only to authenticated users who are on your Business plan.

How to enable this use case? A manner to proceed is to use segmentation for publications that must target connected users that run the Business plan. This works in 2 steps:

You configure a widget to specify what segmented publications to load (in addition to non-segmented publications).
You publish a publication with segment values.

Configuring your Widget

First, you need to configure the widget where you want to enable segmentation. Following our illustration example, it would be the widget that appears in your dashboard. This is done with our JavaScript SDK as follows: noticeable.render('widget', widgetId, {segments: ['Plan:Business']});

The value Plan:Business is called a segment or segment value. It is completely arbitrary and it is up to you to define the value you want based on your use case. Noticeable is simply using a segment as a string to perform equality tests.

Continuing our example, you need to pass the segment Plan:Business in the above call to users who are on that plan only. For users on a different plan, you should pass an adequate value and for users that are not authenticated, you can pass an empty segments array or simply skip the last render(...) parameter. It is up to you to make the choice since only you have this information and know what filtering to apply.

Tagging a Publication for Segmentation

The next step is to tag a publication with one or more segment values. When you create or edit a publication, in step 2 (options), there is a dedicated settings group for Segmentation. Click on the group box and enter each segment values you need in the dedicated input field and validate with Add Segment. Let's say you use Plan:Business as segment:

That's it. Once published the publication above will only be displayed on widgets that have been configured with a matching segment, aka Plan:Business. Publications with no segments are display in all widgets of a same project.

Newspages are configured to not display publications that are segmented (i.e. include segment values). You can force a segmented publications to show on a project Newspage by adding the special segment Noticeable:Newspage to its list of segments.

Use cases are infinite: you can target specific users or companies if a user email or a unique identifier is used as segment value.
Was this article helpful?
Thank you!