Digioh Segment Integration App

Digioh supports turnkey integration with Segment:

  • Automatically Track events with Box form data
  • Supports progressive forms
  • Automatically Identify users in Segment based on email address or other data
  • Target Digioh boxes to known Segment users based on persona traits

If you are setting up a Digioh integration by yourself, we first recommend reading about Digioh Integration Basics.

We support integration via JavaScript (easiest) or Server-to-Server API (additional setup required). If you are using Segment data for mission critical purposes, we recommend the API approach, because Segment JavaScript is blocked by several major Ad Blockers.

The JavaScript method will track events and identify users via your existing Source configured for your website. For API, you can optionally create a separate Source for Digioh if you wish to partition data, or use the writeKey for your default Source (recommended).

Segment Track and Identify with Digioh


From Digioh Custom JS Apps, Install the “Segment Integration” app.

Install Segment Integration App

On the app configuration screen, you are asked to optionally configure the default names for Segment properties (on event) and traits (on identify). This is a mapping from form fields in Digioh (CUSTOM_1 through CUSTOM_10). When forms are submitted, for each active field on the form Digioh will send the data to Segment under that name.

Alternatively or additionally, you can configure the form Field label and Digioh will use the label as the property/trait name. This gives you finer grain control and allows you to use Digioh custom form fields in different order between Boxes or Box pages.

Creating a pop-up form integrated with Segment in the Digioh editor

We recommend configuring defaults for all possible custom fields so that there is always a fallback if the label is not specified for any reason.

Note that the use of labels in this way means that you likely should not enable the label as a visual element on the form. Contact Digioh support if you need to do this.

Advanced Configuration

Once the app is installed, you can perform additional configuration in Parent JS.

Configuring Segment Integration with Custom JavaScript

Comments in the source provides more detail. You can configure:

  • Format of Segment userId, can be email, base64email, or custom (if your ID is stored in a cookie, for example)
  • Persona targeting integration details
  • JavaScript (default) or API integration method
  • Override the default property/trait names for email, phone, name, and opt in checkbox.

If you have any concerns about modifying JavaScript, contact Digioh support (contact@digioh.com) and we’ll be happy to help.

API Integration Method

If you want to use the Server-to-Server API, you’ll need to adjust Parent JS config and create Digioh Integrations and attach them to all of your boxes where data should flow to Segment.

Segment API integration

Create two integrations, one track and one identify. Get the writeKey from Segment and enter that as the API Key for both. Don’t forget to attach these integrations to all boxes you want to integrate with Segment.

Persona Trait Targeting

Digioh supports targeting of known Segment user traits. To enable this, you need to:

  1. In Segment, Personas, go to Settings > API Access, and Generate a new access token. Copy the Space ID and Access Token. (Note that you should not reuse an existing access token.)
  2. Create an Integration in Digioh Segment (Persona), and configure the Space ID and Access Token.
  3. Assuming you have already installed the Segment App in Digioh, configure the SEGMENT_PERSONA_INTEGRATION_ID in Parent JS. See below.
  4. You can now target user traits from box conditions using JavaScript Variable equal (or not equal) DIGIOH_API.traits.traitName.

digioh integrations list


Here’s an example of targeting, showing a Box only to users with the “highValue” trait:

segment trait targeting with Digioh

We recommend writing these Box conditions in the form of reusable Rulesets to hide the technical details.

Useful tips for testing and troubleshooting Segment trait targeting:

  • Segment JS must be present on the page. Open the browser Console (right click, inspect) and enter window.analytics; If this is undefined, segment is not running on that page and trait targeting cannot work. An Ad blocker could be preventing Segment from loading.
  • You can check to see what traits you have in the current browser user-session from the console. Type DIGIOH_API.traits; This will show you the traits as seen by Digioh targeting conditions.