LiveLike

The LiveLike Developer Hub

Welcome to the LiveLike developer hub. You'll find comprehensive guides and documentation to help you start working with LiveLike as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Analytics

The Engagement SDK allows you to hook into our analytic events, making it possible for you to pass through the analytics data to your own provider.

Implementation

The following snippet shows how you can subscribe to analytics events with some common analytics frameworks:

livelikeSdk.analyticService.subscribe(this) { analyticsService ->
        analyticsService?.setEventObserver { eventKey, eventJson ->
        mFirebaseAnalytics.logEvent(eventKey, eventJson)
    }
}

// Only one observer is allowed at a time. 
// To remove the current observer, just pass an empty one:
sdk.analyticService.latest()?.setEventObserver {}
sdk.getAnalyticService().subscribe(this, new Function1<AnalyticsService, Unit>() {
            @Override
            public Unit invoke(AnalyticsService analyticsService) {
                analyticsService.setEventObserver(new Function2<String, JSONObject, Unit>() {
                    @Override
                    public Unit invoke(String eventKey, JSONObject eventJson) {
                        mixpanel.track(eventKey, eventJson);
                        Localytics.tagEvent(eventKey, eventJson);
                        mFirebaseAnalytics.logEvent(eventKey, eventJson);
                        return null;
                    }
                });
            }
        });

The eventKey is the name of the event being fired. The following are the events that we fire. To only register specific events, you can filter down to the ones that you are interested in.

Available Events

The following events with relevant properties are available on Android:

Event

Description

Keyboard Selected

Fired every time the user opens the keyboard. Has a "Keyboard Type" property to represent the "Sticker" or "Standard" keyboard.

Chat Message Sent

Fired each time user sends a message.

Widget Dismissed

Fired when a user takes an action to dismiss the widget, such as when user swiping it away. This is event is not fired when a widget expires on its own

Widget Displayed

Fired when a user receives a widget. (Note: this is a misnomer because the SDK doesn't have control over whether a widget is actually displayed to users - that is up to your application)

Widget Interacted

Fired at the end of widget interaction. Includes a "Number Of Taps" property that counts the number of times a user taps on interactable elements in the widget.

Alert Link Opened

Fired when user clicks on a link in Alert Widget.

Widget Became Interactive

Fired whenever widget becomes interactive for User.

Note : For custom widget events

  1. Widget Became Interactive
    Call the markAsInteractive method available in widget model whenever your Custom Widget UI becomes interactive for the User. Interactive is loosely defined and depends on your specific implementation and use-case. Typically, the Widget is interactive when user is able to submit votes/answers or open links in the case of Alert Widgets. (Available in version 3.0)
// poll widget model for custom poll widget
pollWidgetModel?.markAsInteractive()
pollWidgetModel.markAsInteractive()
  1. Alert Link Opened
    For alert widgets having links, call the alertLinkClicked method available in alert widget model. This will be responsible to trigger the Alert Link Opened event.
// alert widget model for custom alert widget
alertModel.alertLinkClicked(url)
alertModel.alertLinkClicked(url)

Updated 5 months ago

Analytics


Suggested Edits are limited on API Reference Pages

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