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.
From Digioh Custom JS Apps, Install the “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.
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.
Once the app is installed, you can perform additional configuration in Parent JS.
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
- Override the default property/trait names for email, phone, name, and opt in checkbox.
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.
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:
- 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.)
- Create an Integration in Digioh Segment (Persona), and configure the Space ID and Access Token.
- Assuming you have already installed the Segment App in Digioh, configure the SEGMENT_PERSONA_INTEGRATION_ID in Parent JS. See below.
Enter the Box ID for SEGMENT_PERSONA_INTEGRATION_ID.
Here’s an example of targeting, showing a Box only to users with the “highValue” trait:
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.