Track Interventions

Preparing the Intervention

Before starting tracking interventions the following must be defined:
  1. The date of the intervention
  1. The group of users that will receive the intervention
  1. The Begin AI algorithm that impacted the users

Recording the Intervention

Once the data is ready, use the Python Batch SDK to record the interventions by following the steps:

Install the SDK

Install the Begin AI pip library by calling:
pip install beginai
This will initiate the installation process.
If using virtual environments, don’t forget to add beginai to the requirements.txt file as well.
Next, open your Python editor and import the library; then initialize it with the app_id and license_key that you can find under your settings menu in your account.
import Begin as bg applier = bg.AlgorithmsApplier(app_id=APP_ID, license_key=LICENSE_KEY)
Code sample of import command. Make sure to replace APP_ID and LICENSE_KEY with your ID and key.

Prepare the CSV

When using the method record_intervention_dates, the CSV must contain the following structure:
  • id_column: a column representing the id of the User
    • Note: The column doesn’t need to be named id_column
  • intervention_date: a column representing the intervention date (in the format dd-mm-yyyy)
    • Note: The column doesn’t need to be named intervention_date
  • intervention_name: a column representing the name of the intervention being tracked
    • Note: The column doesn’t need to be named intervention_name
  • algorithm_uuid: a column representing the Begin AI algorithm UUID
    • Note: The column doesn’t need to be named algorithm_uuid
 
Your CSV should have the following structure:
id_column,intervention_date,intervention_name,algorithm_uuid
💡
You can track multiple interventions in the same CSV

Track the Interventions in the Dashboard

In the Dashboard, open Engagement Trends-> Interventions, you should be presented with something similar to:
notion image
Select the Algorithm, Intervention and Date to visualize the Intervention Cohort. Once the details are provided, use the Search button.
notion image
💡
The Intervention Cohort is built based on the next 7 days and the number of users that didn’t come back to your application per day