Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Analytics Kotlin Flurry Plugin


Flurry(link takes you to an external page) provides you with the tools and resources you need to gain a deep level of understanding about your users' behavior in your apps.


Getting started

getting-started page anchor
  1. From the Segment web app, click Catalog.
  2. Search for Flurry in the Catalog, select it, and choose which of your sources to connect the destination to.
  3. In the destination settings, enter your Flurry "API Key" in Segment's Settings UI. You can retrieve this from your Flurry Admin > Apps > API Key. It should look like "4KKKGS3BAK4WW8WJ93DN".
  4. Follow the instructions in the GitHub repos: iOS SDK(link takes you to an external page) and Android SDK(link takes you to an external page).
  5. Once the Segment library is integrated with your app, toggle Flurry on in your Segment UI.

Note: Flurry doesn't always display data in real time. It can take anywhere from a few hours to a few days for certain types of data to sync with Flurry.


To install the Segment-Flurry integration, add this line to your gradle file:

implementation 'com.segment.analytics.kotlin.destinations:flurry:<latest_version>'

Or the following for Kotlin DSL:

implementation('com.segment.analytics.kotlin.destinations:flurry:<latest_version>')

Using the plugin in your app

using-the-plugin-in-your-app page anchor

Open the file where you set up and configure the Analytics-Kotlin library. Add this plugin to the list of imports.

import com.segment.analytics.kotlin.destinations.flurry.FlurryDestination

Under your Analytics-Kotlin library setup, call analytics.add(plugin = ...) to add an instance of the plugin to the Analytics timeline.

1
analytics = Analytics("<YOUR WRITE KEY>", applicationContext) {
2
this.flushAt = 3
3
this.trackApplicationLifecycleEvents = true
4
}
5
analytics.add(plugin = FlurryDestination())

Your events will now begin to flow to Flurry in device mode.


If you're not familiar with the Segment Specs, take a look to understand what the Screen method does.

An example Screen call would look like:

1
analytics.screen("ScreenName", buildJsonObject {
2
put("productSlug", "example-product-123")
3
});

Note: When you toggle the Screen Tracks As Events option on in your Flurry Segment UI, Screen calls are treated as events when sending them to Flurry.


If you're not familiar with the Segment Specs, take a look to understand what the Identify method does.

An example Identify call would look like:

1
analytics.identify("user-123", buildJsonObject {
2
put("username", "MisterWhiskers")
3
put("email", "hello@test.com")
4
put("plan", "premium")
5
});

When you call Identify, the user ID is set in Flurry, as are any special Flurry traits you provide, such as gender, or age.


If you're not familiar with the Segment Specs, take a look to understand what the Track method does.

An example Track call would look like:

1
analytics.track("View Product", buildJsonObject {
2
put("productId", 123)
3
put("productName" "Striped trousers")
4
});