MoEngage Docs

Segment Integration : Introduction

Setup guide for using MoEngage with Segment

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.

Getting Started

Segment as a platform supports 2 different connection modes -

Device Mode
This is the preferred connection mode for using Moengage with Segment. With the device mode connection, 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.

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

Cloud Mode
Cloud Mode Connection is used in the below cases -

  1. You would need the Cloud Mode connection if you want to forward data to MoEngage generated by Segment's server side sources.

  2. For your Javascript source and MoEngage destination, you will see an option on your Segment dashboard to select the connection Mode. If you choose "Cloud Mode" here, Segment will forward all track and identify requests to MoEngage via server to server integration if the connection to MoEngage destination is via Cloud Mode.

  3. If you establish a connection between your Android / iOS source and MoEngage destination and MoEngage + Segment code is not bundled on a device, then Segment will send this data to MoEngage via Cloud Mode connection automatically.

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

Configuration on Segment

To setup MoEngage do the following:

  1. First get your key (AppID) from MoEngage dashboard.
  2. Go to Segment dashboard, then go to Integrations and select MoEngage.
  3. Enable MoEngage Integration.
  4. Go to MoEngage Settings and enter the MoEngage AppID, obtained in Step1.
  5. Save the changes.
  6. Make sure the Connection Mode is set to Device Mode. This is required in order to make use of features like push notification and in-app feature of MoEngage SDK. You would also need to update your app with client side integration.

These new settings will take up to an hour to propagate to all of your existing users. For new users it’ll be instantaneous!

Please note that Segment-MoEngage Integration is a bundled integration and requires client side integration.

APP ID : Get the App Id from your MoEngage account.
Enable Debug Logging : Switch it on if you want to enable debug logs. Switching it on will flow your data to TEST environment in MoEngage.
Connection Mode : You will see this option only for the JavaScript source.
For Android, iOS sources, the default connection mode is Device mode.
For Server side sources, default connection mode is Cloud mode.

Which connection mode to choose?

To use MoEngage with Segment, we strongly recommend you to go ahead with the Device Mode connection as all our capabilities are supported with Device Mode.

For sending data to MoEngage via you 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, InApp Messaging - you would need to install the MoEngage SDKs separately.

  2. As of now, 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.

Integration for Device Mode

Below are the steps to get started with Device Mode Configuration -

  1. Add the moengage dependency as per the source.
  2. Follow the documentation mentioned below -

iOS
Android
Web

Integration for Cloud Mode

For your server side sources, Cloud Mode is the default connection mode and you do not need to configure anything here.

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 segment. For users and requests without a user_id, MoEngage will reject the requests.

Updated 6 months ago

Segment Integration : Introduction


Setup guide for using MoEngage with Segment

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.