Documentation

Documentation

YourOwn SetupYourOwn SDKYourOwn API
Sphere SetupSphere SDKSphere API
  • Resources

›Firebase Web

Configuration

  • Firebase configuration steps
  • Tuya configuration steps
  • DKIM setup

Troubleshooting

  • In-App messages
  • Events and Report

Firebase Web

  • Firebase Web
  • When to trigger events
  • Code snippet

When to trigger events

You'll see some basic events in the code snippet, here's a short explanation of when you should call them

Account Creation Events

Sign up

Trigger logSignup upon receiving a confirmation from Copilot.cx that the account was created.

Successful Elevate Anonymous

Trigger logSuccessfulElevateAnonymous upon successful elevation of anonymous user to a registered user.

Login

Trigger logLogin after receiving confirmation for successful login.

💡 Login event should not be reported in the case of silent log in.

Logout

Trigger logLogout after successful logout.

User Actions

Accept Terms of use

Trigger logAcceptTerms after user accepted terms and condition. This event has a version property which indicates the version of the T&C file the user agreed to.

Onboarding Events

Onboarding Started / Ended

logOnboardingStarted and logOnboardingEnded should be sent in the beginning and the end of the onboarding process.

Copilot.cx general definition is that onboarding starts right after a user signs up, and ends after a successful connection to the thing. However, this is a business definition, and may vary between apps. Place these events at your discretion.

Capturing these events enables calculating Onboarding Success Percentage in Copilot.cx dashboard, and target users who have started the onboarding process, but failed to complete it.

Thing Events

Tap connect device

Trigger logTapConnectDevice when a user taps a button to start the process of connecting to a thing.

Thing discovered

Trigger logThingDiscovered when there's an indication from client apps that a thing was discovered through BLE, WiFi etc. This event will be used to differentiate between users who have a thing but failed to connect it, and users who don't have a thing.

💡 thingId is an optional field

Thing connected

Trigger logThingConnected when a communication between the app and the device was established successfully.

💡 This event must include the device's thingId (the unique physical id of the device, matching also the value in the model thingInfo.thingId) as a property.

Thing info

Trigger logThingInfo to send additional information about the physical device and should be sent right after the Thing Connected event, as soon as Thing model and firmware are available.

💡 This event must include the device's thingId (the unique physical id of the device, matching also the value in the model thingInfo.thingId) as a property.

Thing Connection Failed

Trigger logThingConnectionFailed when failing to connect to a thing. Possible values for example are No Bluetooth/Timeout/Thing not found etc.

Consumable Usage

Trigger logConsumableUsage in case your product has a consumable element (paper, cartridge, razor, etc…) and a user consumes it. This will later be used to identify consumable usage patterns and deviations from these patterns.

  • thingId (String) - The specific thing the user would like to get support for (Optional).
  • consumableType (String) If you have several types of consumables, add the consumable type as a parameter (Optional).
  • screenName (String) The screen which the user interacted with to file the support case (Optional).

General Events

Screen load

Trigger logScreenLoad when a new app screen appears on the user’s screen, for example: login/register.

💡 Screen names should be matching between the platforms and no platform specific. Avoid using the screens names like SignupWebView, SignupViewController or FriendsListFragment but use SignupScreen and FriendsListScreen.

Tap Menu

Trigger logTapMenu when user opens any type of menu.

Tap Menu Item

Trigger logTapMenuItem when a user taps an item in the menu.

Event property menuItem should pass the name of the item the user selected. For example: Settings/FAQ/Terms and Conditions etc.

Firmware upgrade started

Trigger logFirmwareUpgradeStarted at the beginning and the end of a firmware upgrade process.

Firmware upgrade completed

Trigger logFirmwareUpgradeComplete upon upgrade completion, attach a FirmwareUpgradeCompletedStatus property to the event, with possible values of Success or Failure.

Error Report

Trigger the logErrorReport optional event to track errors that occur while using the app. Example of such errors: No Bluetooth/Timeout/Connection Failed/etc.

← Firebase WebCode snippet →
  • Account Creation Events
    • Sign up
    • Successful Elevate Anonymous
    • Login
    • Logout
  • User Actions
    • Accept Terms of use
  • Onboarding Events
    • Onboarding Started / Ended
  • Thing Events
    • Tap connect device
    • Thing discovered
    • Thing connected
    • Thing info
    • Thing Connection Failed
    • Consumable Usage
  • General Events
    • Screen load
    • Tap Menu
    • Tap Menu Item
    • Firmware upgrade started
    • Firmware upgrade completed
    • Error Report
Copilot
Mail: hello@copilot.cx
Call: (212).398.0001
© Copilot.cx 2025