name={`Segment ${idx+1}`}
filter={ Utils.createUserFilter([idx]) }>
Create Segment

Use <Segment> to create a link inside of your Insight, which once clicked, opens a segmentation filter modal, with all segment user properties set already. This can be used for example when displaying the results of a clustering analysis, where each cluster becomes a clickable link, allowing end-user of Insight to easily use this segment anywhere in reports, intelligence models, etc.

const intelligenceModel = new Intelligence({
goal: {
event: 'paid',
times: 1
const clusters = await PluginData.get('clustering', {data: intelligenceModel});
return {
origResult: clusters
<Insight title='Automatic User Segments'>
<Title>Shows all the user segments found in your data</Title>
Segment 1 looks like a group with high conversion, using from desktop computers.
<Segment name='Segment 1' filter={ Utils.createUserFilter(data.clusters[0], data.origResult) }>Create segment from this.</Segment>
Segment 2 looks like a group with average conversion, using from mobile devices.
<Segment name='Segment 2' filter={ Utils.createUserFilter(data.clusters[1], data.origResult) }>Create segment from this.</Segment>


{name: "filter", type: "object", description: An valid filter object. This can be created through a utility function: ${this.code("Utils.createUserFilter(['(', ['feature_abc', '=', 'green'], ')', 'OR', '(', ['feature_def', '>', 30], ')'], data.origResult)")}. The clusters object is the result object of a ${this.code("PluginData.get")} call.}