WebEngage Destination

Segment makes it easy to send your data to WebEngage (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to WebEngage in the format they understand. Learn more about how to use WebEngage with Segment.

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.**

Supported Sources and Connection Modes

WebMobileServer
📱 Device-based
☁️ Cloud-based

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

Segment offers an optional Device-based Connection Mode for Mobile data with WebEngage. If you’d like to use those features that require client-based functionality, follow the steps above to ensure you have packaged the WebEngage SDK with Segment’s.

Settings

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

API Key

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

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.


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!