Telemetry User Actions

How are the user actions (sign up/sign in/sign out) tracked by our Telemetry components?

Problem

We want to track whenever a Black Diamond user:

  1. Signs In

  2. Signs Out

  3. Signs Up

Solution

Changes in the Database, where the data is stored

A table was added in the Assessment DB. That table is called TelemetryUserAction. It has the following columns:

  1. Id

  2. UserId: The azure user ID used by Microsoft to uniquely identify the user

  3. UserEmail: The email that is present in the Active Directory for the user. This can be null for some users.

  4. Platform: Indicates which platform was the user logged into. It will probably be BDS.

  5. Action: It can be

    1. sign-in

    2. sign-out

    3. sign-up

  6. Timestamp

Endpoints in the Telemetry API

POST https://api-telemetry-staging.azurewebsites.net/bds/{actionId}

Creates a sign up/sign out/sign up log for the corresponding user.

Path Parameters

NameTypeDescription

actionId*

String

The Id for the action performed. It can be sign-up, sign-in or sign-out.

Query Parameters

NameTypeDescription

apiKey*

String

The API Key. Changes depending on the environment.

Request Body

NameTypeDescription

objectId

String

The azure user ID.

mail

String

The email for the user.

{
    // Response
}

Calls to the Telemetry API

Sign Up

When a user is created using the BDS user creation endpoint (https://bds.mobilize.net/api/users), a request is sent to the Telemetry API. This request is sent from the backend of the BDS portal. You can review Commit b0471e24 for more information.

Sign In

When a user signs in, the Azure B2C sends a request to the Telemetry API. The code for this request was added in Commit 8b027378. In that commit:

  1. The TelemetryApiUrl environment variable was added to the appsettings.json file.

  2. A technical profile was added (ReportLogin). This technical profile includes the objectId and mail claims in the body of the request.

  3. The User Journey SignUpOrSignIn was overwritten to include the step in which the ReportLogin technical profile is used.

  4. The User Journey SignUpOrSignInWithForgotPassword now includes a step in which the ReportLogin technical profile is used.

Sign Out

When a user signs out, the frontend of the portal sends a request to the backend of the portal. There, the backend retrieves the necessary information and sends the request to the Telemetry API. You can review Commit b0471e24 for more information.

Last updated