Keen Destination

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

Getting Started

When you enable Keen in the Segment web app, your changes appear in the Segment CDN in about 45 minutes, and then Analytics.js starts asynchronously loading keen.js onto your page. This means you should remove Keen’s snippet from your page.

  • Since Keen only records custom events and custom user data, no events or users will appear in Keen until you start using the API outlined below.

Keen is supported on the client side and server side.


Identify

Client-Side

When you call identify on analytics.js, we call Keen’s setGlobalProperties and set the user field with userId and traits.

Note: To see this information inside Keen, you must make track call as the userId and traits are simply cached on the client. Your subsequent track calls will be appended with the userId and traits.

Server-Side

On the server-side, calling identify has no effect on Keen.

Track

Client-Side

When you call track or one of its helpers functions on analytics.js, we call Keen’s addEvent with exactly the same parameters.

Server-Side

When you call track on on the server-side, we route the event to Keen.

If you make the following Segment call using any of the server-side sources,

analytics.track('user@example.com', 'Purchased', {
    item: 'T-Shirt',
    revenue: 19.99
});

We will forward the following to Keen:

  • Event Collection: Purchased
  • Event Properties:
    {
      userId: 'user@example.com'
      item: 'T-Shirt',
      revenue: 19.99
    }
    

Engage

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 Keen may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.

Settings

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

Setting Description
Track an Initial Pageview boolean, defaults to FALSE .

This will send an intial ‘Loaded a Page’ event to Keen when the page is loaded. We disable this by default since Keen is generally used for custom event tracking, not pageviews. Note: you must also have the Send Pageview Events setting enabled for this to work.
Geo IP Addon boolean, defaults to FALSE .

Enable this to use Keen’s data enrichment feature to add geographic information based on IP.
Project ID
(required)
string. Your project ID. It should be 24 characters long, and look something like this: 9181bcd23843312d87000000.
Read Key string. If you are a Keen Pro user, enter your read key in the advanced settings tab of your dashboard. It should be a minimum of 32 characters long and made up of numbers and letters only.
Referrer Parsing Addon boolean, defaults to FALSE .

Enable this to use the Keen IO’s data enrichment feature for parsing referrer URLs into their source.
Track All Pages to Keen boolean, defaults to TRUE .

This will track Loaded a Page events to Keen for all page method calls.
Track Categorized Pages to Keen boolean, defaults to TRUE .

This will track events to Keen for page method calls that have a category associated with them. For example page('Docs', 'Index') would translate to Viewed Docs Page.
Track Named Pages to Keen boolean, defaults to TRUE .

This will track events to Keen for page method calls that have a name associated with them. For example page('Signup') would translate to Viewed Signup Page.
UserAgent Addon boolean, defaults to FALSE .

Enable this to use the Keen’s data enrichment to parse UserAgent strings.
URL Parsing Addon boolean, defaults to FALSE .

Enable this to use the Keen’s data enrichment feature for parsing URLs into its components for easier filtering. Note that userAgent is only collected on Android, not on iOS.
Write Key
(required)
string. Your write key should be a minimum of 32 characters long and made up of numbers and letters only.

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.
or
Create free account