What are cohorts?

Cohorts are identifiers for a session, represented as key-value pairs (e.g., account_type: paid), that enable you to filter sessions in Adora. Each session can have an unlimited number of cohorts.

Examples of useful cohort data include:

  • Experiment flags (e.g., new_onboarding_experience = true)
  • User account data (e.g., type = free, type = paid)
  • User settings (e.g., light-mode = dark)

What is captured?

By default, the Adora snippet automatically captures the following:

  • Country: Inferred from the user’s IP address.
  • Language: Determined by the browser’s language setting (navigator.language).
  • Browser and device type: Extracted from the user agent.

Additional data can be supplied to enhance session details:

  • User ID: A unique identifier for a user.
  • User Cohort: Custom key-value pairs that you define.

Overriding the language

If your application’s displayed language is determined by user account settings rather than the browser, you can manually override the language by specifying the language parameter in adoraStart using an ISO 639-1 code (optionally with a country code):

adoraStart({
  orgId: "ORGANIZATION_ID",
  language: "en-AU"
});

Adding User IDs

To uniquely identify a user, include a uid argument in adoraStart:

adoraStart({
  orgId: "ORGANIZATION_ID",
  uid: "UID"
});

The uid can be either a string or a number.


Adding Custom Cohort Data

Custom cohort data can be added using the userCohorts field in adoraStart. This field accepts a set of arbitrary string key-value pairs for flexible segmentation.

adoraStart({
  orgId: "ORGANIZATION_ID",
  userCohorts: {
    "plan": "free",
    "theme": "dark",
    "has_new_onboarding_flow": "true"
  }
});