Overview

Introduction

Segment is a customer data platform that helps you collect, clean, and activate your customer data.

If you are already using Segment for tracking data, then the Segment - MoEngage Integration makes it extremely easy for you to send your event and attribute data to MoEngage.

Once you've tracked your data through Segment's source libraries, Segment will translate this and route your data to MoEngage in the format MoEngage understands so that you can save some of your engineering efforts for using MoEngage. Learn more about how to use MoEngage with Segment.

Scope

The MoEngage and Segment integration allow you to track your users and route data to a wide variety of user analytics providers. Segment allows you to:

  • Import data across two platforms. We offer a side-by-side (device mode) SDK integration for your Android, iOS, and web applications and a server-to-server integration for your backend services.
  • Send campaign data to segment using MoEngage Streams
  • Sync Segment Personas (cohorts) to MoEngage for use in MoEngage segments and campaigns. 

Integration

The Segment Integration with MoEngage consists of two parts:

1. Data Sync from Segment to MoEngage:

Segment to MoEngage integration allows you to export user data in Segment to MoEngage and send personalized campaigns to all the users from MoEngage. 

 

library_add_check

PREREQUISITES

  • Login credentials for MoEngage and Segment.
  • Installed source and Segment source libraries - The origin of any data sent into Segments, such as mobile apps, websites, or backend servers. You must install the libraries into your app, site, or server before being able to set up a successful Source > Destination flow.

Step 1: Configure MoEngage settings in Segment

Once you add the Segment-MoEngage library to your app, you can enable MoEngage from the Segment App. These new settings can take up to an hour to propagate to your existing users. For new users, it’ll be instantaneous. 

To setup MoEngage, do the following :

  1. Get your key (AppID) from the MoEngage dashboard.
  2. Go to your Segment workspace, go to Destinations, and select MoEngage.
  3. Enable the MoEngage Destination.
  4. Go to the MoEngage Settings and enter the MoEngage AppID obtained in Step 1.
  5. Save the changes.
Entity Description
Workspace ID Get the Workspace Id by navigating to Navigate to MoEngage Dashboard > Settings > General
Debug Logging Switch it on if you want to enable debug logs. Switching it on will flow your data to the TEST environment in MoEngage

Connection Mode

(You will see this option only for the JavaScript source)

Android & iOS: Default connection mode is Device mode Server-side: Default connection mode is Cloud mode

Step 2: Choose the integration type and implement

The MoEngage <> Segment Integration supports the following -

  • Segment -> MoEngage Data Integration:
    With this integration mode, Segment will forward the data collected from your sources to MoEngage automatically. The data points that will be forwarded to MoEngage are Events and User Properties.

    Segment <> MoEngage integration supports two different connection modes for forwarding the data from Segment to MoEngage -
    • Device Mode (Side by side)- Device mode enables all MoEngage capabilities for your mobile app and also forwards all data to MoEngage directly from your mobile app. This is the preferred mode. 
    • Cloud mode (Server to server) - Cloud mode is recommended for sending offline data to MoEngage.  

More details on each type of integration are covered in the next sections.

Device Mode (side by side)

This is the preferred connection mode for using MoEngage with Segment. With the device mode connection, the segment will forward all track and identify requests to MoEngage directly via the user's device. Here, your app will make separate requests to Segment and MoEngage without you having to send data to MoEngage explicitly.

Please ensure that you are integrating the MoEngage + Segment bundle if you want to use Device Mode on Android and iOS, and ensure that you are selecting Device Mode connection for your website data.

Connecting MoEngage Destination for Android and iOS Source -

Screenshot_2022-06-02_at_3.06.41_PM.png

Operating System Browser
   

 

For using the device mode connection and leveraging all MoEngage capabilities, you would need to follow the integration steps mentioned below: 

  1. Add the MoEngage dependency as per the source.
  2. Follow the documentation :
iOS Android Web
To complete the side-by-side integration, please refer to Segment’s detailed instructions for iOS

 

Cloud Mode (side by side)

Cloud Mode integration is beneficial in the following scenarios-

  1. Forward data to MoEngage generated by Segment's server-side sources.
  2. For the connection between your Android / iOS source and MoEngage destination, the MoEngage + Segment code is not bundled on a device; then Segment will send this data via Cloud Mode connection automatically.

You can refer to Segment documentation for more information on Segment sourcesMoEngage destination, and supported connection modes.

warning

Limitations

There are some limitations while using Cloud Mode Integration -

1. Segment will transform all your attributes (properties) from camelCase to snake_case before sending this data to MoEngage (only via Cloud Mode). This may result in you seeing multiple attributes listed on your MoEngage dashboard. Such transformation does not happen when you are in Device Mode.

2. MoEngage can only track the data of logged-in users via Cloud Mode. Logged-in users are all users for whom a user_id is available in the segment. For users and requests without a user_id, MoEngage will reject the requests.

 

Step 3: Test your integration

You can view your data in the recent events, segments, or analytics sections. MoEngage allows you to filter your users based on the custom event and attribute data.

 

2. Streaming MoEngage Events to Segment

MoEngage to Segment integration allows you to export the campaign interaction events generated after your users engage with the MoEngage campaigns to Segment. To set up this integration, follow the MoEngage (Source) help doc

Once you have enabled the data export integration from MoEngage, you should start seeing the campaign events generated by MoEngage in Segment and all destinations connected to your MoEngage source in Segment.

The data points sent to Segment from MoEngage are available here.

 

check_circle

Which connection mode to choose?

To use MoEngage with Segment, we strongly recommend you go ahead with the Device Mode connection, as all our capabilities are supported with Device Mode. For sending data to MoEngage using your server-side sources, you would always need to use Cloud Mode.

While MoEngage ingests data sent via Segment Cloud Mode connection, there are a few limitations with this approach as of now -

1. For using MoEngage Push Notifications and In-App Messaging - you would need to install the MoEngage SDKs separately.

2. MoEngage only accepts data via Cloud Mode if the User Id is present. If the User Id is not present, the data will be rejected by MoEngage Cloud Destination.

3. If the connection mode is cloud mode, you cannot use MoEngage functionalities like Real-Time Triggers, On-site Messaging, and Smart In-App Messaging.

 

Segment Replays

Segment Replay takes an archived copy of your Segment data, and re-sends it to MoEngage. With this, you can import all historical data from Segment to MoEngage. Contact your Segment CSM for more information related to Segment Replays.

Previous

Next

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?