﻿# Event Tracking

## Introduction

Cloud Softphone app can be integrated with Google Firebase service to allow tracking of certain in-app events for
purposes like:

* analytics for running advertising campaings, conversion tracking
* monitoring user behaviors, early detection of situations with poor user experience
* usage statistics, demographics, details about audience

Event tracking has to be enabled in "Features" section of your Cloud Softphone app. It is currently only available for
full white-label apps. Once the feature is enabled, you will be able to fill in the credentials for your event tracking
service inside the "Whitelabel options" step.

## Supported Event Tracking Services

Cloud Softphone currently supports the following event tracking system:

* Google Firebase (<https: firebase.google.com>)

## Reported Events

Cloud Softphone has to map in-app events to the events recognized by the tracking service.
A list of types of tracked events and their event name mappings follow.

### Account Created { .reference-entry }

This event is reported when user creates a new account and saves it This typically happens after the app is
provisioned. Note that this event does no checking whether the account is valid or whether it was successfully registered.

Mappings:

| Service | Event Name |
| --- | --- |
| Firebase | signup |

### Account Registered { .reference-entry }

Reported when an account successfully registers with SIP server. This usually happens shortly after the app is started
or moved from background to foreground.

Mappings:

| Service | Event Name |
| --- | --- |
| Firebase | login |

### App Started { .reference-entry }

Reported whenever the app is started.

!!! important
    Note that this event is reported only when the app is already provisioned. Starting the app into initial screen
    where the user can scan QR code, fill in `username&password` or go through registration wizard will NOT trigger this
    event.

Mappings:

| Service | Event Name |
| --- | --- |
| Firebase | app_start |

### Outgoing Call { .reference-entry }

Reported whenever the user originates an outgoing call.

Mappings:

| Service | Event Name |
| --- | --- |
| Firebase | callout |

### Incoming Call { .reference-entry }

Reported whenever the user receives an incoming call. This event is reported for both pushed and direct incoming calls,
including calls handled by CallKit on iOS. The event is reported at the time the incoming call is received, regardless
of whether the user answers or whether the call is rejected by DND etc.

Mappings:

| Service | Event Name |
| --- | --- |
| Firebase | callin |

### Call Ended { .reference-entry }

Reported when the call reaches terminal state (user hangs up, call is terminated because of no network etc.)

Mappings:

| Service | Event Name |
| --- | --- |
| Firebase | callend |

### Screen View { .reference-entry }

Reported when the user switches screens inside the app. The event has a parameter which says which screen has been
shown.

Mappings:

| Service | Event Name |
| --- | --- |
| Firebase | screen_view |