WebEngage Destination


This integration is maintained by WebEngage Support.

Getting Started

Steps to integrate Segment with WebEngage:

You will be required to provide the API key if you intend on sending any via WebEngage’s server-side component. The API key can be found in your WebEngage dashboard on the top right under Integrations > REST API. If you don’t have a WebEngage account, you can create one here.

If you’d like to use leverage the client-side web or mobile bundled SDKs, please enter your License Code. WebEngage only needs the License Code you want to enable the device/packaged Integration which will allow you to leverage WebEngage’s in-app and push notification functionality.

Do note that WebEngage for Mobile supports only the Identify and Track methods.

Android

To install the WebEngage-Segment integration, simply add this line to your app’s build.gradle file:

 compile 'com.webengage:android-segment:2.+'

After adding the dependency, you must register the WebEngage’s destination in your Segment’s Analytics instance. To do this, import the WebEngage integration:

 import com.webengage.sdk.android.integrations.segment.WebEngageIntegration;

And add the following line:

analytics = new Analytics.Builder(this, "YOUR_SEGMENT_WRITE_KEY")
                .use(WebEngageIntegration.FACTORY)
                .build();

iOS

To install the Segment-WebEngage integration, simply add this line to your CocoaPods Podfile:

pod "Segment-WebEngage"

If you are using XCode 8 and face any build issues try following before contacting support:

pod "Segment-WebEngage/Xcode8"

After adding the dependency, you must register the integration with our SDK. To do this, import the WebEngage integration in your AppDelegate:

#import <Segment-WebEngage/WEGSegmentIntegrationFactory.h>

And add the following lines to your AppDelegate’s application:didFinishLaunching:WithOptions: method

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    //Initialise Segment
    SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:@"XXXXXXXXXXXXXXXXXXXXXXXXXXX"];

    //Additional Segment Configuration
    configuration.trackApplicationLifecycleEvents = NO; // Enable this to record certain application events automatically!
    configuration.recordScreenViews = NO; // Enable this to record screen views automatically!

    //Register WebEngage Integration With Segment
    [configuration use:[WEGSegmentIntegrationFactory instanceWithApplication:application launchOptions:launchOptions]];

    [SEGAnalytics setupWithConfiguration:configuration];

    return YES;
}

Page

This is only supported on the client side web component. Sending page events via server side integration is not supported.

Identify

When a user is identified, Segment will send that user’s information to WebEngage, wherein a user will be created/updated. The anonymousId must be present in case of an anonymous user and userId in case of an identified user. We will map semantic traits such as your first name, email, gender, etc and also send along any custom traits.

Track

When you track an event, Segment will send that event and its properties to WebEngage. Each event will have the necessary data about the user (anonymousId and userId) who performed the event.

An event name can be maximum 50 characters long. Event attribute values can be booleans, numbers, strings and dates only. The maximum length of attribute names is 50 characters and of String data type attribute values is 1000 characters.

You cannot start your event or event attribute names with we_.

In an account, events can have at most 25 attributes of each data type type (i.e. 25 String type attributes, 25 Number type attributes etc.) across all instances of a particular event.

Reset

The reset call must be invoked when a user is logged out.


Features

Push Notifications

Please follow WebEngage’s push notification documentation:

In-App Notifications

No further action is required to enable in-app messaging.

Proguard

Include the following rules in your ProGuard file.

 -keep class com.webengage.sdk.android.**{*;}
-dontwarn com.webengage.sdk.android.**

Personas

You can send computed traits and audiences generated through Segment Personas to this destination as a user property. To learn more about Personas, reach out for a demo.

For user-property destinations, an identify call will be sent to the destination for each user being added and removed. The property name will be the snake_cased version of the audience name you provide with a true/false value. For example, when a user first completes an order in the last 30 days, we will send an identify call with the property order_completed_last_30days: true, and when this user no longer satisfies we will set that value to false.

When the audience is first created an identify call is sent for every user in the audience. Subsequent syncs will only send updates for those users which were added or removed since the last sync.

Supported Sources and Connection Modes

The first step is to make sure WebEngage supports the source type and connection mode you’ve chosen to implement. You can learn more about what dictates the connection modes we support here.

Web Mobile Server
📱 Device-mode
☁️ Cloud-mode

To learn more about about Connection Modes and what dictates which we support, see here.

Settings

Segment lets you change these destination settings from your Segment dashboard without having to touch any code.

License Code

Required only if you are loading WebEngage client side on your web browser or via the bundled mobile SDKs. You can find your License Code in your WebEngage account.

API Key

Required if you are sending data to WebEngage via their server-side component.

Get started with Segment

Segment is the easiest way to integrate your websites & mobile apps data to over 300 analytics and growth tools.
or
Create free account