You can integrate Flagsmith with Heap Analytics. The integration automatically sends the flag states for identified users into Heap for cohort analysis, A/B testing and more. The process is as follows:
- Get the Heap Project Environment ID for your Heap project from the Heap Manage Project page (Account > Manage > Projects > Environment > Get ID)
- Add the ID key into Flagsmith (Integrations > Add Heap Integration)
- All API calls generated by the Flagsmith SDK to the
Get Identity Flagsendpoint will send the a full set of flag evaluations for that particular user to Heap as an
How it Works
For flags that contain remote config values, Flagsmith will pass the value of the flag to Heap if the flag is
If the flag has no remote config value, Flagsmith will just pass the boolean state for the flag.
Identity flag values are passed into Heap.
Here's a demo user in Flagsmith:
If we make the call to the Flagsmith API to get the flags for this user:
curl 'https://api.flagsmith.com/api/v1/identities/?identifier=development_user_123456' \
-H 'x-environment-key: 8KzETdDeMY7xkqkSkY3Gsg'
And then take a look in our Heap dashboard, you can see the user and the flag data that has been sent to the Heap platform.
Once the integration has been set up, you can start segmenting your Heap identities based on the flags that they saw. This means you can run AB tests driven by Flagsmith segments, and have the data show up automatically in Heap.
You have to identify users on both platforms in the same way. The Flagsmith
Identity ID must be the same as the Heap