Targeting Segment Persona Traits with Digioh Conditions

If you have the Segment Persona API, the Digioh Segment Integration App also supports targeting Digioh boxes to traits (and audiences). Install that app before getting started here, then set up as follows:

1. Create a Digioh integration object to securely store your credentials.

Go to the integrations tab, click New Integration, find Segment (Personas) in the list under CDP, and give your integration a meaningful name, e.g. indicating whether it is your production or QA environment.

2. Enter the Access Token and Space ID.

Instructions on how to find this in Segment are linked from this configuration page.

3. Configure Account Metadata.

Note the 5 digit Integration ID from the list on the main Integrations page, and your Segment Space ID. Then under the Admin menu open Account Metadata. If you don’t have access to the Admin Menu, contact Digioh support for help. Input and save key values for seg_persona_integration_id and seg_persona_space_id. You can use these metadata keys as is for global defaults, and/or domain specific key suffixes to automatically use a different configuration on different sites (e.g. your development or QA environment might point to a Segment sandbox instance).

Best practice is to configure domain specific suffixes for all sites where you want the app to run and no global default.

4. Limit Scope of Returned Traits (Optional).

If your user traits in Segment contain PII or sensitive information that should not be exposed to the Internet, you can limit the data returned to the browser to a list of specific traits. In Digioh Account Metadata, configure seg_allowed_traits with a comma separated list of trait names:
All traits returned by the Segment Persona API other that those listed will be removed.

5. Publish your Digioh Account

You’re ready to start targeting your Segment personas!

How to Target Traits in Box Conditions

When users start a session on your site, Digioh will look up their traits in Segment in real-time, then cache them for the remainder of the session. The app stores persona traits in a JavaScript object called seg_traits, so you will use JavaScript Variable conditions for your Box:

Use your trait name, with prefix seg_traits. – the dot is important, so for example seg_traits.num_purchases, if your trait name is num_purchases.

IMPORTANT: If the trait does not exist, or if Segment isn’t running in the browser for any reason (e.g. blocked by an Ad Blocker), then the condition value will always be false. You should avoid negative targeting with seg_trait conditions (e.g. does not equal), because this may result in unexpected behavior. Instead, always use positive targeting like equals, contains, greater/less than, etc.

How to use Persona Traits in Box Content

You can extract traits and display them in the box content. First, you’ll need to install the Universal Merge Tags App. Then, with a merge tag you can display any trait in a text, button, or HTML element, and even as a part of a redirect URL.

The syntax is: [SEG_TRAIT|traitName|optionalDefault]

Running into an issue or have a question? Reach out to our support team via and we’ll be happy to help!