Heap is a Product Analytics company that provides analytics infrastructure and helps their clients to focus on discovering insights and taking action, not writing tracking code.
The Heap Analytics integration allows you to send the Feature Experimentation & Rollouts (FE&R formerly Flagship) campaign data to your Heap Analytics project.
How Campaign Data Is Sent
Each time you have a FE&R campaign, a hit is generated and sent into Heap. Instead of AB Tasty client side, where the hit is sent thanks to a native method provided by the Heap tag, here, we send the hit thanks to the Heap API.
See documentation here:
- Event name is "flagship"
- flagship_campaign contains the Campaign ID and Campaign Name formatted as [campaign_id] campaign_name
- flagship_variation contains the Variation ID and Variation Name formatted as [variation_id] variation_name
-
visitorID: This visitor Id you provide when the decision API is called
How to set up the integration
Heap dashboard
- Go to your Heap dashboard and click: Account > Manage > Projects
- Click on the project in which you want to export data. A right panel is displayed with 2 environments. Copy the desired ID environment.
FE&R dashboard
- Go to the FE&R dashboard > Settings > Integrations and select the “Push” tab.
- Select Heap analytics from the dropdown list. An input is display with the label app ID. Paste the ID you copied from the Heap dashboard.
- Click Add Tool
Your integration is done!
Decision API
In order to retrieve the data into Heap, you must call the decision API. When a FE&R campaign is live, the decision API is called with something like that:
curl -X POST \
https://decision.flagship.io/v2/{{YOUR_ENV_ID}}/campaigns \
-H 'Content-Type: application/json' \
-H 'x-api-key: VCSvGHthIEsUTarbRhzmhetbyPvsPGjShoJQmUtw' \
-d '{
"visitor_id": "YOUR_VISITOR_ID",
"context": {},
"visitor_consent": true,
"trigger_hit": true,
"decision_group": null
}'
So each time this decision API will be called, one (or several) hits are automatically sent into HEAP with the FE&R campaign information.
How to check data
Into your Heap dashboard, go to Data > live data feed.
Inside this streaming of live data and each time the decision API is called, you will see that the FE&R event is available (this event can take up to 5 / 10 min to be displayed).
Event: Flagship
Identity or UserId // the visitorId you give inside the decision API
Other properties: Id + name of campaign // id + name of variation