1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/website/docs/how-to/how-to-send-impression-data-to-a-sink.md
2022-02-09 14:20:24 +01:00

1.6 KiB

title
How to send impression data to a sink

Unleash allows you to gather impression data from your feature toggles, giving you complete visibility into who checked what toggles and when. What you do with this data is entirely up to you, but a common use case is to send it off to an aggregation and analytics service such as Google Analytics or Posthog.

This guide will take you through everything you need to do in Unleash to facilitate such a workflow. It will show you how to send data to Google Analytics (and Posthog?) as an example sink, but the exact same principles will apply to any other service of the same kind.

Prerequisites

We will assume that you have the necessary details for your third-party service:

  • where to send the data to. We'll refer to this in the code samples below as <sink-url>.
  • what format the data needs to be in. This will determine how you transform the event data before you send it.

In addition you'll need to have a toggle to record impression data for and an Unleash client SDK that supports impression data. This guide will use the JavaScript proxy SDK.

When you have those things sorted, follow the below steps.

Enable impression data for your feature toggle

This is in the admin UI ... you do this by

Enabling impression data for new toggles

Enabling impression data for existing toggles

Capture impression events in your client

Transform the data

Send the event data to your sink