Skip to content

Commit

Permalink
build for Kibana v7.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ylasri committed Aug 22, 2020
1 parent c61ba8d commit 58c28fa
Show file tree
Hide file tree
Showing 30 changed files with 90,749 additions and 19,652 deletions.
165 changes: 165 additions & 0 deletions build/kibana/kibana_cohort/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Cohort Analysis

This part was found [here](https://www.kdnuggets.com/2016/05/clevertap-use-cohort-analysis-improve-customer-retention.html)

Long-term success for app developers does not mean only getting someone to download their app, but also getting them to make repeat visits. To get to the must-have value proposition of your app product, you need to go beyond vanity metrics – like download counts and even daily active users (DAU) / monthly active users (MAU) – that only measure growth and retention superficially. You need to dig deeper into your app using a method –Cohort Analysis.

## What is Cohort Analysis

Cohort analysis is a subset of behavioral analytics that takes the data from a given eCommerce platform, web application, or online game and rather than looking at all users as one unit, it breaks them into related groups for analysis. These related groups, or cohorts, usually share common characteristics or experiences within a defined time-span.

Cohort analysis is a tool to measure user engagement over time. It helps to know whether user engagement is actually getting better over time or is only appearing to improve because of growth.

Cohort analysis proves to be valuable because it helps to separate growth metrics from engagement metrics as growth can easily mask engagement problems. In reality, the lack of activity of the old users is being hidden by the impressive growth numbers of new users, which results in concealing the lack of engagement from a small number of people.

Let’s understand using cohort analysis with an example – daily cohort of users who have launched an app first time and revisited the app in the next 10 days.

<img src="./screens/table1a2.png" align="middle">

From the above retention table – Triangular chart, we can infer the following

- 1358 users launched an app on Jan 26. Day 1 retention was 31.1%, day 7 retention was 12.9%, and day 9 retention was 11.3%. So on the 7th day after using the app, 1 in 8 users who launched an app on Jan 26 were still active users on the app.

- Out of all of the new users during this time range (13,487 users), 27% users are retained on day 1, 12.5% on day 7, and 12.1% on day 10.

Furthermore, two main benefits of reading the above cohort table, are:

- Product lifetime (as depicted vertically down in the table) – comparing different cohorts at the same stage in their life cycle – we can see what % of people in a cohort are coming back to app after 3 days and so on. The early lifetime months can be linked to the quality of your onboarding experience and the performance of customer success team, and

- User lifetime (as depicted horizontally to the right of the table) – seeing the long term relationship with people in any cohort – to ascertain how long people are coming back and how strong or how valuable that cohort is. This can be presumably linked to something like the quality of the product, operations, and customer support.

Whatever the evaluation key metrics you define for the business, cohort analysis lets you view how the metrics develop over the customer lifetime as well as over the product lifetime.

## How to Improve Your Retention Cohort

Cohort analysis involves looking at the groups of people, over time, and observing how their behavior changes. For instance, if we send out an email notification to 100 people, some may buy the product on day 1, less on day 2, even fewer on day 3, and so on. But, if we send another email to 100 people, after few weeks, they’ll be buying the product on their “day 0”while the first sent email might show its prevalent lag effect on the buying decision.

In order to track how users behave over time or how the same behavior differs for different cohorts, cohort analysis helps to compare these people by the way / time they were acquired or by the retention of those users over time.

But, how to break the group of users into cohorts for cohort analysis – can be done in two ways:

- `Acquisition Cohorts` : divide users by when they signed up first for your product. For your app users, you might break down your cohorts by the day, the week or the month they launched an app, and thereby track daily, weekly or monthly cohorts.
In this case, by measuring the retention of these cohorts, you can determine how long people continue to use your app from their start point.

- `Behavioral Cohorts` : divide users by the behaviors they have (or haven’t) taken in your app within a given time period. These could be any number of discrete actions that a user can perform – App Install, App Launch, App Uninstall, Transaction or Charged, or any combination of these actions / events.

In this case, a cohort can be a group of users who did certain actions within a specified timeframe – say, within first 3 days of app use. You can then monitor how long different cohorts stay active in your app after they perform certain actions.

Let’s see how you can use both acquisition and behavioral cohorts to determine exactly what your users are doing and when they’re doing it.

> Acquisition Cohorts – Finding Problem Moments in Your App
Revisiting the above daily cohort – which is an acquisition cohort.

<img src="./screens/table1b.png" align="middle">

One way to visualize this information is to chart out a retention curve, showing the retention of these cohorts over time. The chart makes incredibly easy to infer when users are leaving your product.

This retention curve immediately reflects an important insight – about 75% of the users stop using the app after the 1st day. After that initial large drop, a second brisk drop occurs after 5th day – to under 12%, before the curve starts to level off after 7th day, leaving about 11% of original users still active in the app at day 10.

The above retention curve indicates that users are not getting quickly to the core value of the app, resulting in drop-offs. Hence, it’s evident to improve the on-boarding experience to get the user to the core value as quickly as possible, thereby boosting the retention.

Thus, acquisition cohorts are great for identifying trends and the point when people are churning, but it’s hard to make actionable insights like – to understand why they are leaving – which requires the use of another type of cohorts, behavioral cohorts

> Behavioral Cohorts – Discover Which Behaviors Drive Retention
A simple example of behavioral cohort can be – all users who read reviews prior to purchasing a product. This can answer interesting questions, like,

Are the users who read reviews have a higher conversion rate than those users who don’t read reviews, or
Are the users more engaged – longer sessions, more time in app, fewer drop-offs
An app user, after an app install and / or launch, makes hundreds of decisions and exhibit countless little behaviors that lead towards their decision to stay or go. These behaviors could be anything, like, using core feature Y but not using core feature Z, engaging only with notifications of type X, and so on.

Let’s test user’s behavior by comparing retention between below cohorts:

<img src="./screens/behavioral-cohorts.png" align="middle">


Both user segments had the intention to transact on your app. But one user segment chose to proceed with the checkout, the other choose to abandon your app. What you can do to reduce the shopping cart abandonment?

Cohort analysis can get answers to the questions like:

- When is the best time to re-engage with your users? When is the best time for remarketing?

- What is the rate of acquisition of new users to maintain (if not increase) your app conversion rate?

From the above retention tables, you can conclude that majority of the users who had abandoned the shopping cart did not engage with the app again, not even 1 day after the acquisition date. So, you have less than 24 hours to re-target them with the new offer and increase the chances of getting revenue.

From this data, you can develop a systematic, quantitative approach to know how users can fall in love with your app – and then make it happen again and again. Also, you can make strategies to increase your retention after ascertaining what works and what doesn’t.

Conclusion

The power of cohort analysis lies in the fact that, it enables not only to view which customers leave and when they leave, but also to understand why the customers leave your app – so that you can fix it. That’s how one can identify how well the users are being retained and also determine the primary factors driving the growth, engagement and revenue for the app.

# Kibana Plugin - Cohort Analysis

This project is a simple tutorial for Kibana new comers trying to develop their own vizualisation plugin. The actual usecase of this plugin is to create a custom cohort visualization based on React and Elastic EUI.

As plugin architecture is being under heavy redesign in 7.x and documentation is rather obscure, I did my best to create something simple that works. The code is also basic, I am JS & React beginner.

This repository is for Kibana v7.8.x plugin New Platform (NP)

This plugin is adapted from the [elo7 plugin](https://github.com/elo7/cohort)

## Sample Screenshots

Few screen shots which makes it very easy to understand.

<img src="./screens/cohort_table.png" align="middle">
This is an example of Cohort analysis using Elastic EUI Table



<img src="./screens/cohort_chart.png" align="middle">
This is an example of Cohort analysis using Elastic EUI Charts

<img src="./screens/cohort_dashboard.png" align="middle">
This is an example of Cohort analysis Visualization inside a dashboard.


## Usage

The **total** metric is the value that determine y-axis. Can be either a count or a sum. It also possible to use the percentual as y value just marking the option `Show percetual values`.

<img src="./screens/metric.png" align="middle">


The **cohort date** bucket is the date used to draw the chart lines. Each bucket is a line in this chart. It should be a date histogram.

<img src="./screens/date.png" align="middle">

The **cohort period** bucket is the "cohort" itself that determine the x-axis. It should be a numeric histogram.

<img src="./screens/period.png" align="middle">

## Installing the plugin

The plugin can then be installed like this

```
kibana-plugin install https://github.com/synapticielfactory/kibana_cohort/releases/download/v7.8.0/kibana_cohort_7.8.0_0.0.1.zip
```

## Install on Windows

````
kibana-plugin.bat install https://github.com/synapticielfactory/kibana_cohort/releases/download/v7.8.0/kibana_cohort_7.8.0_0.0.1.zip
Attempting to transfer from https://github.com/synapticielfactory/kibana_cohort/releases/download/v7.8.0/kibana_cohort_7.8.0_0.0.1.zip
Transferring 815445 bytes....................
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete
Plugin installation complete
````

## Remove on Windows

````
kibana-plugin.bat list
kibana_cohort@0.0.1
kibana-plugin.bat remove kibana_cohort
Removing kibana_cohort...
Plugin removal complete
````
26 changes: 26 additions & 0 deletions build/kibana/kibana_cohort/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { schema, TypeOf } from '@kbn/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
});

export type ConfigSchema = TypeOf<typeof configSchema>;
8 changes: 8 additions & 0 deletions build/kibana/kibana_cohort/kibana.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "kibanaCohort",
"version": "0.0.1",
"kibanaVersion": "kibana",
"ui": true,
"server": true,
"requiredPlugins": ["expressions", "visualizations", "data", "charts", "kibanaUtils", "kibanaReact"]
}
37 changes: 37 additions & 0 deletions build/kibana/kibana_cohort/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "kibana_cohort",
"version": "0.0.1",
"description": "Cohort Analysis",
"private": true,
"author": "Yassine LASRI <yassine.lasri@synapticiel.co>",
"license": "MIT",
"contributors": [],
"kibana": {
"version": "7.9.0",
"templateVersion": "1.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/synapticielfactory/kibana_cohort.git"
},
"keywords": [
"cohort",
"kibana",
"plugin",
"visualization",
"churn",
"retention"
],
"homepage": "https://github.com/synapticielfactory/kibana_cohort",
"bugs": {
"url": "https://github.com/synapticielfactory/kibana_cohort/issues"
},
"build": {
"git": {
"count": "6",
"sha": "c61ba8d",
"date": "Sat, 22 Aug 2020 20:24:29 +0100"
},
"date": "Sat Aug 22 2020 20:47:09 GMT+0100 (GMT+01:00)"
}
}
81 changes: 81 additions & 0 deletions build/kibana/kibana_cohort/public/cohort_vis_options.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import React, { useCallback, Fragment } from 'react';
import { EuiCheckbox, EuiFlexItem, EuiIconTip, EuiFlexGroup } from '@elastic/eui';
import { VisOptionsProps } from '../../../src/plugins/vis_default_editor/public';
import { CohortVisParams } from './types';

function CohortOptionsParams({ stateParams, setValue }: VisOptionsProps<CohortVisParams>) {
const onChangePercentual = useCallback(
(value: CohortVisParams['percentual']) => setValue('percentual', value),
[setValue]
);

const onChangeInverse = useCallback(
(value: CohortVisParams['inverse']) => setValue('inverse', value),
[setValue]
);

const onChangeCumulative = useCallback(
(value: CohortVisParams['cumulative']) => setValue('cumulative', value),
[setValue]
);

const onChangeTable = useCallback((value: CohortVisParams['table']) => setValue('table', value), [
setValue,
]);
return (
<Fragment>
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
<EuiFlexItem grow={false}>
<EuiCheckbox
id="percentual"
label="Show percentual values"
checked={stateParams.percentual}
onChange={({ target: { checked } }) => onChangePercentual(Boolean(checked))}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiIconTip content="Show % values" position="right" />
</EuiFlexItem>
</EuiFlexGroup>
<EuiCheckbox
id="inverse"
label="Show inverse values"
checked={stateParams.inverse}
onChange={({ target: { checked } }) => onChangeInverse(Boolean(checked))}
/>
<EuiCheckbox
id="cumulative"
label="Show cumulative values"
checked={stateParams.cumulative}
onChange={({ target: { checked } }) => onChangeCumulative(Boolean(checked))}
/>
<EuiCheckbox
id="table"
label="Show values as table"
checked={stateParams.table}
onChange={({ target: { checked } }) => onChangeTable(Boolean(checked))}
/>
</Fragment>
);
}

export { CohortOptionsParams };
Loading

0 comments on commit 58c28fa

Please sign in to comment.