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.
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.
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.
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 :
- Get your key (AppID) from the MoEngage dashboard.
- Go to your Segment workspace, go to Destinations and select MoEngage.
- Enable the MoEngage Destination.
- Go to the MoEngage Settings and enter the MoEngage AppID, obtained in Step1.
- Save the changes.
|APP ID||Get the App 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|
|Android & iOS: Default connection mode is Device mode Server-side: Default connection mode is Cloud mode|
Step 2: Choose 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 forward all data to MoEngage directly from your mobile app. This is the preferred mode.
- Cloud mode (Server to server) - Cloud mode is recommended for send offline data to MoEngage.
More details on each type of integration is 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 -
For using the device mode connection and leveraging all MoEngage capabilities, you would need to follow the integration steps mentioned below:
- Add the MoEngage dependency as per the source.
- Follow the documentation :
Cloud Mode (side by side)
Cloud Mode integration is beneficial in the following scenarios-
- Forward data to MoEngage generated by Segment's server side sources.
- 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 sources, MoEngage destination, and supported connection modes.
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 on Device Mode.
2. MoEngage can only track 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.
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 connection mode is cloud mode, you cannot use MoEngage functionalities like Real-Time Triggers, On-site Messaging, and Smart In-App Messaging.