How to Integrate with Segment

Segment is a powerful CDP platform to collect, clean, and control customer data. By using the Segment API in Digioh you can capture valuable first party data from web forms, landing pages, and subscriber paywalls, and send it to Segment. In addition, when your users enter their email in a form, Digioh can identify that user, tying their Segment persona to an actual person.

Here is an example of how you can pass data to Segment when a user submits a form. In “Custom JS Boxes”, create a new snippet on After Box Submit:

if (typeof window.analytics !== 'undefined') {
    let sObj = {};
    sObj.email = x.email;
    sObj.custom1 = x.custom_1;  //and any other form fields you want
    sObj.digiohBoxName = boxapi.getName();
    sObj.pagePath = api.getPagePath();
    sObj.country = api.getClientCountryCode();
    sObj.city = api.getClientCity();

    window.parent.analytics.track('Digioh Form Submission', sObj);
    window.parent.analytics(x.email, sObj);
} else {
    console.log('Segment API not found');
}

This will pass select form fields and analytics data anytime some submits the form. You can also pass data when a box is displayed and when a box is closed. The Digioh JavaScript API provides a wide range of functions and data that you can send to Segment.

We also have the ability to target boxes based on your Segment Persona data, please contact us to help you set that up.