Analytics & Telemetry

There are two tools provided for gathering data about your users and their activities. Both tools are optional if privacy is more important than data.

Analytics

Analytics data is generated from the Client XDK UI Components to report on user behaviors within your applications so that your application can chose to listen for these events and log them to the logging service of your choice.

Note

Analytics data is made available to your application so your application may log it; Layer’s XDKs do not record any analytics data locally or on Layer servers; this data is available to you alone.

The following activities are reported via Analytics Events:

  • Messages Viewed
  • Messages Clicked
  • Carousel Messages Scrolled

Messages Viewed

Messages Viewed events are triggered whenever messages are:

  • Displayed in the Message List
  • Scrolled within the Message List
  • A new messages arrives and the Message List automatically scrolls its self to the bottom
  • App changes from running in background to foreground
Name Type Description
message Message Message object representing the Message that was viewed
- (void)addNotificationObserver {
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(didReceiveAnalyticsEvent:)
                                                 name:LYRClientDidPostAnalyticsEventNotification
                                               object:self.layerClient];  
}

- (void)didReceiveAnalyticsEvent:(NSNotification *)notification {
    __kindof LYRAnalyticsEvent *event = notification[LYRClientAnalyticsEventObjectUserInfoKey];
    if ([event isKindOfClass:LYRUIMessageViewedAnalyticsEvent.class]) {
        // Handle the LYRUIMessageViewedAnalyticsEvent
    }
}

Messages Selected

Messages Selected events are triggered whenever messages are:

  • Displayed in the Message List and tapped/clicked within the Message List
  • Displayed outside of the Message List and tapped/clicked
  • Currently these are not reported when the user has navigated to a Large Message Viewer and then tapped/clicked on the message in the Viewer
Name Type Description
message Message Message object representing the Message that was selected
- (void)addNotificationObserver {
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(didReceiveAnalyticsEvent:)
                                                 name:LYRClientDidPostAnalyticsEventNotification
                                               object:self.layerClient];  
}

- (void)didReceiveAnalyticsEvent:(NSNotification *)notification {
    __kindof LYRAnalyticsEvent *event = notification[LYRClientAnalyticsEventObjectUserInfoKey];
    if ([event isKindOfClass:LYRUIMessageSelectedAnalyticsEvent.class]) {
        // Handle the LYRUIMessageSelectedAnalyticsEvent
    }
}

Carousel Messages present a collection of items. Knowing that users are scrolling through these items may help you understand more about what users are doing with your Carousels. Carousel Scroll Events:

  • Report what items were previously visible
  • Report what items are now visible
Name Type Description
message Message Message object that contains the carousel
scrollPosition int The horizontal scroll position of the carousel
- (void)addNotificationObserver {
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(didReceiveAnalyticsEvent:)
                                                 name:LYRClientDidPostAnalyticsEventNotification
                                               object:self.layerClient];  
}

- (void)didReceiveAnalyticsEvent:(NSNotification *)notification {
    __kindof LYRAnalyticsEvent *event = notification[LYRClientAnalyticsEventObjectUserInfoKey];
    if ([event isKindOfClass:LYRUICarouselScrolledAnalyticsEvent.class]) {
        // Handle the LYRUICarouselScrolledAnalyticsEvent
    }
}

Telemetry

Layer Clients collect telemetry data to better understand how the SDKs are used, what actions users are taking, and what performance those users are observing. No Personally Identifiable Information is collected, and telemetry can be disabled if desired.

What you should know about this data:

  • No user identifiable data is tracked; no user_ids, names, message content, conversation metadata, nor any data about whom you are having conversations with
  • We do track:
    • how many messages are sent
    • how many conversations are created
    • how many authentications/deauthentications
    • how many queries are fired, and whether those queries are on Messages, Conversations, Identities, Announcements, etc.
    • how many syncs are performed by the device
    • how quickly each of the above activies were performed

This data will allow us to better tune our services for performance, and to better model and optimize based on how users are using our services. In the future, it will also be made available to Layer’s customers so they can better analyze how their apps are being used.

Telemetry can be disabled:

LYRClientOptions *clientOptions = [[LYRClientOptions init] alloc];
clientOptions.telemetryEnabled = NO;
[LYRClient clientWithAppID:@"layer:///apps/staging/YOUR-APP-ID" delegate:delegate options:clientOptions];
Privacy UI Concepts