Digioh supports turnkey integration with Segment:
- Track named events with form data as properties
- Supports progressive forms for data “accumulation”
- Set traits on Segment users from form data
From Digioh Custom JS (Apps), install the “Segment Track and Traits” app.
Install the app once. It is an “always on” app, which reacts only when you have configured Boxes with specific controlling metadata.
Once the app is installed, you configure how you want it to work for one or more of your Boxes. If you are just getting started with Digioh, we recommend that you create a Box to serve as a template including standard Segment config that you can clone.
Available metadata commands are:
- seg_track = eventName: page-level metadata command that initiates a track event immediately when the Box page is shown
- seg_traits = true: page-level metadata command that initiates a Segment identify call set to set traits using the anonymousId, after a page’s form is submitted
- seg_prop = propName: form Field level attribute that indicates the field should be included in the payload for track and traits operations
Page-level metadata is configured from the Box Editor, under the Layout sub-menu for each page:
You may need to scroll down to see it, right at the bottom:
This example shows a track event on the Main page. Note that this will fire immediately on Box Display, since the Main page is always shown immediately on display.
seg_traits is configured the same way, but differs in that it fires immediately after the form on that page is submitted.
seg_traits and seg_track are “commands”, whereas seg_prop is a form-Field level “attribute” that indicates that field data should be passed in the payload to the track or traits command.
Field-level metadata is configured from Box page > Form > Fields:
Pick the specific field you want to pass to Segment, then at the bottom of the section you can configure seg_prop to name it in Segment. Digioh will construct a payload including the property/trait name you entered, and the value of the field at time of form submission.
Tips and Best Practices
- The app will not function in Box Previews, since there is no Segment JS available, Boxes need to be displaying on your site, with Segment JS
- For testing, use the Segment “debug” tab for your default web source, this will show track and identify calls in real-time
- seg_traits and seg_track will grab seg_prop data from forms on all pages of your box, it’s not just the data from that pages form
- seg_prop values are ignored at time of seg_track or seg_traits if they are blank, they are not included in the payload
- You can be aggressive when using seg_traits, for example by invoking it on every page. Setting of traits is cumulative.
- seg_traits and seg_track essentially carry the same payload. Use seg_track for tracking engagement, and traits for setting profile data
- If you want to include “static” information, such as a campaign ID for a specific box, create a hidden field on the Boxes first form with Default Value of your ID, and apply seg_prop=CampaignId to the field
Any questions, just contact Digioh support (firstname.lastname@example.org) and we’ll be happy to help.