Digioh Segment Integration App

Digioh App Marketplace

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
  • Target Segment traits in Digioh box conditions (requires Segment Persona API; separate help doc)
  • Pass anonymousId and/or userId to your email platform or CRM via a Digioh integration

The Digioh Segment App requires that you have installed the Segment JavaScript tag on your site, and will track events and identify users via the existing Segment Source configured for your website. If you need to use the Segment Server-to-Server API instead of the JavaScript tag, please contact Digioh Support.

Segment Track and Identify with Digioh

Setup

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.

Box Configuration

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- or button-level metadata command that initiates a track event immediately when the Box page is shown or button is clicked
  • 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
  • seg_pageprop = propName=propVal: for more advanced use cases, page-level metadata that sets static prop=val for seg_track and seg_traits operations on this page.

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, and seg_pageprop is a page-level static attribute.

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.

With seg_pageprop, configure that in Page-level metadata. Digioh doesn’t allow duplicate metadata keys at the same level, so if you need to set more than one page property for a page, then you can comma separate them like this:

seg_pageprop : favorite_color=green,high_score=120

Segment & Digioh Integrations

By default, the Segment Track and Traits app will store the userId (if available) in [CUSTOM_48] and the anonymousId in [CUSTOM_49] and passed with all submissions. You can reference these fields in the integration template as needed. When this app is installed, do not use these also fields for form input or it will be clobbered by the app.

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. Note that seg_track events occur before form submission, so hidden fields on that page will not be carried with the event. However …
  • seg_pageprop is particularly useful if you want to trigger a seg_track event when a box displays and send box specific data, e.g. a campaign ID.

Finally, if you have the Segment Persona API, this Segment Integration App also supports targeting of Digioh Box Conditions to persona traits in real-time. More information here: Targeting Segment Persona Traits with Digioh Conditions

 

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

 

Tagged: