Kahuna Destination

Destination Info
Connection Modes
Device-mode Cloud-mode
Web Web
Mobile Mobile
Server Server

Getting Started

Segment makes it easy to send your data to Kahuna. When you tracking your data using Segment’s open-source libraries, Segment translates and routes your data to Kahuna in a format it can process.

If you have mobile apps, then Kahuna recommends that you use the Segment iOS and or Android library and bundling Kahuna (see Mobile section below).

If you are sending data from a server side library, read the Server side section.

Be sure to enable Kahuna in your Segment destinations page and provide your Kahuna Secret Key, which you can find in the Settings page of the Kahuna Dashboard.


To use the full capability of Kahuna’s Push Messaging and In-App features, you will have to bundle the Kahuna SDK while configuring your Segment mobile SDKs.


Add this to your project gradle file:

allprojects {
  repositories {
    maven { url "https://kahuna.github.io/kahuna-android/integration" }
    maven { url "https://kahuna.github.ios/kahuna-android/sdk" }

Add this to your app level gradle file:

compile ('com.kahuna.integration.android.segment:kahuna:+') {
  transitive = true

Then, bundle Kahuna during your Segment Analytics initialization, with more details here:

Analytics analytics = new Analytics.Builder(this, "SEGMENT_KEY")


Add the Kahuna pod dependency:

pod "Segment-Kahuna

Then, bundle Kahuna during your Segment Analytics initialization, with more details here:

#import <Segment-Kahuna/SEGKahunaIntegrationFactory.h>
SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY"];

[config use:[SEGKahunaIntegrationFactory instance]];

[SEGAnalytics setupWithConfiguration:config];

Push Notifications

To use the Push Notifications and In-App functionality provided by Kahuna, follow the steps in the Kahuna SDK destination guide:


If your app supports the ability for a user to logout and login with a new identity, then you’ll need to call reset in your mobile app. Here Segment calls Kahuna’s logout implementation to ensure the user information remains consistent.


If you are using Segment’s iOS or Android libraries but have not bundled Kahuna’s SDK as described in the mobile section above, Segment uses the server side destination by default. It is recommended that you bundle the Kahuna’s SDK in order to use features such as Push Notifications and In-App features.

However, any data coming from sources other than mobile apps should be using the server side destination.


If you are using the server side destination for Kahuna, Segment recommend you set the Segment batching options as follows (note: these settings would apply to all of your Segment destinations):

  • flushAt to 100
  • flushAfter to 30 minutes (or 1800000 ms)


Our server-side destination supports the ability to register user information with Kahuna through our identify calls. This will allow you to organize and segment your Kahuna campaigns according to the user information that you have sent.

The first thing you’ll want to do is to identify a user with any relevant information as soon as they launch the app. You record this with our identify method.

Identify takes the userId of a user and any traits you know about them.

When you call identify, we’ll set two Kahuna Credentials, user_id and email. Any other traits will instead be sent to Kahuna as user_info, which are User Attributes in Kahuna.

We will also send any relevant device information such as device token, app name and version, OS and browser name, etc.


You can also use track calls to send event data using Kahuna’s Intelligent Events.

Whenever you call track, we’ll send an event to Kahuna with the event name and a unix timestamp. We will also pass through any properties of the event. If properties.quantity and properties.revenue are set, then Segment sends the event name as well as count and value. For value, Segment first multiplies properties.revenue by 100 before sending to Kahuna, because Kahuna tracks value in cents not dollars.

Note: We will flatten any compound objects such as nested objects or arrays. We will also strip any properties that have values of null since Kahuna’s API does not support these values. Lastly, just like the identify call, Segment send any relevant device parameters it can send based off the context of the call.


When you call screen in your mobile app, Segment sends a screen view to Kahuna for mobile apps if trackAllPages is enabled for your Kahuna destination. If enabled, Segment track a Kahuna event with the format “Viewed screen.name Screen”. If you want to enable sending screenevents to Kahuna, simply check the box for: Track All Pages from your Segment Kahuna settings page.


Segment supports a deeper Kahuna destination with e-commerce tracking in our mobile SDKs (NOT in server side). All you have to do is adhere to our e-commerce tracking API and we’ll track Kahuna e-commerce specific user attributes.

Viewed Product Category

For Viewed Product Category, Segment tracks the Kahuna User Attributes “Last Viewed Category” and “Categories Viewed”. The value for Last Viewed Category will be taken from properties.category, “None” if unspecified. The value of Categories Viewed will be a list of the last 50 unique categories the user viewed, also taken from properties.category.

Viewed Product

For Viewed Product, Segment tracks the same Kahuna User Attributes as Viewed Product Category. We also will track another User Attribute called “Last Product Viewed Name” with the value taken from properties.name.

Added Product

For Added Product, Segment tracks the Kahuna User Attributes “Last Product Added To Cart Name” taken from properties.name and “Last Product Added To Cart Category” taken from properties.category. If category is unspecified, Segment tracks “None”.

Order Completed

For Order Completed, Segment tracks the Kahuna User Attributes “Last Purchase Discount” taken from properties.discount. If discount is unspecified, Segment tracks 0.

Send Push Token using Server-Side

If you chose not to bundle the Kahuna Mobile SDK, then you will have to implement your own Push Message processors, and you won’t have access to Kahuna’s In-App feature.

If you decide to implement your own Push Message processors, then make sure you pass the Push Tokens to Kahuna using Server Side. You can do this by sending it inside context.device.token. We will send this to Kahuna as push_token.


You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo.

For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it’s been more than 30 days since their last order), Engage sets that value to false.

When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.

Real-time to batch destination sync frequency

Real-time audience syncs to Kahuna may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.


Segment lets you change these destination settings from the Segment app without having to touch any code.

Setting Description
Secret Key
string. Specify the Secret Key from Kahuna (located in Kahuna’s dashboard’s settings).
Send data to production environment (default sandbox)
boolean, defaults to FALSE .

Check to send data to production account (default sandbox) once you are ready to pass data to Kahuna’s production namespace
Sender ID / Google API Project Number
string. If you are using our older mobile library (before v2 iOS or v3 Android) and have packaged Kahuna’s SDK, you can give us the sender ID. The sender ID is also called the project number in your Google API project. Make sure you have created a project by following instructions here, under ‘Enable Personalized Push’

This page was last modified: 08 Mar 2022

Get started with Segment

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