Segments

Segment Overview

Both events and user profile attributes are used in segments.

  • Events are used in segments for targeting user behaviors and triggers.
  • User Profiles attributes are used in segments for computed or CRM data.

You can push to user segments, run A/B tests on user segments, and analyze campaign results by segments. In the TUNE SDK,  check whether the current user is in a given segment ID after creating a segment. Verifying if a user is in a given segment helps determine custom segment logic in your app.  After navigating to the Segments tab and clicking on an individual Segment, an ID value displays. You may pass this value, or multiple ID values, to the SDK to determine if the user belongs to this segment.

These calls should be made after the first playlist has been downloaded. To ensure that this event has occurred, put these calls inside the Playlist Callback block.

Note: Language is defined on the device. TUNE collects language on the device level with our SDK, and this information is populated in the profile table. And regardless of a users physical location, language is based on the selected language for a device. For more information on language and location, please see our In-App Marketing Creating Lists & Segments article.

Personalize App Experiences by User Segment

To check if a user is in a single segment, use the isUserInSegmentId method, passing in the segment ID.

Is User in Single Segment
Select a preferred platform.

Check if a User is in Any of Multiple Segments

To check if a user is in one of multiple segments, use the isUserInAnySegmentIds method, passing in all the segment IDs you want to find a match for.

This returns true if at least one segment ID matches.

Is User in Any of Multiple Segments
Select a preferred platform.

Using Power Hooks to Pass Segment IDs

You can use Power Hooks to control the segment IDs you wish to check.

You can change the segment IDs server-side, rather than hard-coding them into your app. You can then control sending different segments of users to different workflows with a power hook update
instead of an app update.

Use Power Hook to get Segment ID
Select a preferred platform.

Force User into Segment

For debugging purposes, TUNE provides a setter that force sets the user into a given segment. This allows you to test that your app logic runs correctly, without having to actually get your test device into the segment being tested.

Note: This only sets the user's segment status locally; it does not actually change whether a user is in a segment and not server-side.

Remove the following call before releasing your app so that the user is sorted into their natural segments.

Force Set User in Segment
Select a preferred platform.
Have a Question? Please contact support@tune.com for technical support.