Targeting: User Segments

User Segments with Storyly

This guide shows how to use Story Labeling to target your user segments.

👍

You can also check out the demo on GitHub

Storyly Demo for Swift

Storyly Demo for Objective-C

📘

Before you begin

You need to have the working Storyly setup as described in Initial SDK Setup

We will create a Story Group and this Story Group will be shown the users whose segments are ["married", "Europe"].

Set Your Labels in Storyly Dashboard

In the Storyly Dashboard, while creating story groups, you will see an option called Audience. Here you can set your labels ["married", "Europe"] by enabling Labels checkbox. You may use AND , OR options according to your targeting conditions.

10201020

Passing Segments to Storyly SDK

In Storyly SDK, labels are called segments, and the process is called StorylySegmentation. The application must set ["married", "Europe"] in segments parameters in StorylyInit class while initializing the Storyly SDK.

StorylyInit(storylyId: String, segmentation: StorylySegmentation)

In StorylySegmentation class, the segments parameter takes a set of strings that will be used in the process of segmentation to show specific story groups to the users.

StorylySegmentation(segments: Set<String>)

Example Usage

  • If you do not give any parameters to segments, Storyly SDK will show all active story groups with/without labels. This is the default behavior.
  • If you use AND condition for ["married", "europe"] labels in Audience, Storyly SDK will show the story group if you give ["married"] and ["europe"] parameters to segments. In this case, Storyly SDK will also show the story groups without labels.
  • If you use OR condition for ["married", "europe"] labels, Storyly SDK will show the story group if you give ["married", "europe"], ["married"] and ["europe"] parameters to segments. In this case, Storyly SDK will also show the story groups without labels.
  • If you set an empty value to the segments, only the story groups without labels will be shown.

Custom Audience with Storyly

This guide shows how to use Custom Audience to target your user.

👍

You can also check out the demo on GitHub

Storyly Demo for Swift

Storyly Demo for Objective-C

📘

Before you begin

You need to have the working Storyly setup as described in Initial SDK Setup

Upload Your CSV File in Storyly Dashboard

Custom Audience enables you to target specific users by matching the user information.
The CSV File must include the Custom Parameter that your app passes to Storyly SDK.

While creating or editing a Story Group, you can upload your CSV File.

10401040

Passing Custom Parameter to Storyly SDK

This section shows you how to pass a custom parameter to Storyly SDK.

Storyly SDK allows you to send a string parameter in the initialization process. In StorylyInit class, the customParameter field is used for passing Custom Parameter to Storyly SDK to match the user info that you upload in previous section.

StorylyInit(storylyId: String,
            customParameter: String)
[[StorylyInit alloc] initWithStorylyId:NSString
                       customParameter:NSString];

🚧

Warning

You are allowed to send a 200 characters string value with the customParameter field. If you exceed the size limit, your value will be set to null.