Set up a server-side segment

portrait de l'auteur Julie Trenque

Written by Julie Trenque

Updated on 05/22/2023

4 min

Advanced

Was this content useful?

A server-side segment is a specific segment for server-side experiments where only specific targeting conditions are available.

A server-side segment:

  • can only be created via the Code editor;
  • can only contain the targeting conditions “Custom data”, “Campaign” and “Page URL”.
  • can only be used in a 100% server-side experiment.

There are two ways to obtain a server-side segment:

  • either create a new server-side segment;
  • or transform a client-side (“classic”) segment into a server-side one.

These two actions are possible by clicking on the “Targeting” block in the “Finalize” part of the Code editor.

Learn more about server-side experiments

Access the Code editor

From the experiment dashboard, click on “New experiment”

Select “In the Code editor”.

To create a server-side, mobile app or client-side experiment with one of our SDKs, select the “SDK” type of experiment.

Enter the mandatory fields and click on “Validate”.

The Code editor launches in a new tab.

Create a new server-side segment

In the “Finalize” part of the configuration of your experiment via the Code editor, click on “Targeting” to associate a segment to your experiment.

Then click on “Create a new segment” to open the segment builder popin.

External Segment Sync for Server-side

If you would like to use GA, Mixpanel, Segment.io, Mediarithmics, or Matomo segment data with one of our SDKs, you will need to follow the guidelines provided in each SDK documentation and use the method retrievedatafromremotesource.

Enter your segment’s name and description

The first fields to fill in are the website for which you create this segment and the name you want to give it. You can also add a description and/or tags.

The description is not mandatory but strongly recommended so that you can quickly identify your segments in the list.

Select and set a condition

To add a condition, simply drag and drop a condition from the left-side list to the right field.

Only 3 types of conditions are available for server-side segments:

  • Visited pages > “Page URL” (for Nginx or Apache);
  • Campaign > “Targeted Experiment” / “Exclusive Experiment” (for Java, C#, PHP and NodeJS);
  • “Custom data” (for Java or C# only).

Once you have dragged and dropped a condition, its specific settings are displayed.

Determine the weight

For each condition, a weight icon enables you to prioritize them: the higher the number, the more important the condition. This setting is for advanced use only and not mandatory.

By default, all conditions have a weight of 1.

You can learn more about weight and how works in our articles on Exposure settings and How to use the weight of conditions?

Delete the condition

To delete a condition, click on the cross below the weight icon.

Fine-tune or add a new condition

To add a new condition when a condition is already selected, two options are available:

  • Fine-tune an existing condition: further specifies a condition. This corresponds to the addition of mathematical parentheses: (Condition A and Condition B) and Condition C
  • Add a new condition: adds a condition at the same level: Condition A and Condition B and Condition C

Validate

Then validate the creation of your server-side segment. It is automatically associated with the experiment.

You can edit its configuration, but not modify its server-side type.

You will find it in the finalization panel, in the “Targeting” tab.

Learn more about targeting in server-side experiments

Transform a client-side segment into a server-side segment

In the “Finalize” part of the configuration of your experiment via the Code editor, click on “Targeting” to associate a segment to your experiment.

Then select an existing segment in the dropdown.

The listed segments are:

  • classic segments that only use “Page URL” and “Custom data” targeting conditions;
  • server-side segments.

If the classic segment is not used on an active experiment (online, deviated, paused or planned), you can either duplicate or turn it into a server-side segment.

If the classic segment is used on at least one active experiment (online, deviated, paused or planned), you can only duplicate it.

Duplicate

If the classic segment is not used on an active experiment (online, deviated, paused or planned):

  • you can choose between duplicating the segment or transforming it;
  • simply click on the “Duplicate” button;
  • the classic segment is duplicated (this action keeps the classic segment and creates a server-side copy containing the same conditions and settings);
  • the newly duplicated segment is now associated with the 100% server-side experiment and can be used in server-side experiments only.

If the classic segment is currently used on at least one active experiment (online, deviated, paused or planned):

  • an alert pop-in indicates that the segment is in use and that to be able to modify its type you need to duplicate it;
  • while hovering the list icon on the bottom left, you can check all the active experiments on which this segment is used;
  • if you still want to change the type of the segment, click on the duplicate button;
  • the classic segment is duplicated (this action keeps the classic segment and creates a server-side copy containing the same conditions and settings);
  • the newly duplicated segment is now associated with the 100% server-side experiment and can be used in server-side experiments only.

The name of a duplicate segment automatically takes this format: segment-name-[COPY].

Transformate

If the client-side segment is not used on an active experiment (online, deviated, paused or planned):

  • an alert message asks you to confirm this transformation;
  • simply click on the “Transform” button to validate;
  • the classic segment is automatically turned into a server-side one, keeping the same conditions and settings (this action is irreversible);
  • the newly transformed segment is now associated with the 100% server-side experiment and can be used in server-side experiments only.

Validate

You can edit the configuration of the server-side segment, but not modify its type.

You will find it in the finalization panel, in the “Targeting” tab.

Learn more about targeting in server-side experiments

Manage server-side segments

On the Segments page, server-side segments are automatically flagged with the “SERVER-SIDE” tag.

This tag cannot be removed, modified or manually added to a segment.

You can filter the Segments page using this tag: only the server-side segments will be displayed.

  • In this article :