Back to Posthog

Toolbar telemetry events

frontend/src/toolbar/TELEMETRY.md

1.43.112.0 KB
Original Source

Toolbar telemetry events

All events are sent via toolbarPosthogJS, the toolbar's internal PostHog instance, unless noted otherwise. Events go to PostHog's internal project (prod) or localhost:8000 (dev).

Lifecycle

toolbar loaded

Fired once when the toolbar finishes initialization.

PropertyTypeDescription
is_authenticatedbooleanWhether the user had valid tokens at load time
source'url' | 'localstorage' | 'unknown'Whether the toolbar was launched from PostHog or auto-loaded from localStorage
ui_hoststringResolved PostHog UI host
api_hoststringResolved API host
ui_host_explicitbooleanWhether uiHost was explicitly provided in toolbar params
ui_host_matches_api_hostbooleanWhether UI and API hosts are the same
load_duration_msnumber | undefinedTime from ph_load_toolbar call to initialization complete

File: toolbarConfigLogic.ts

toolbar ui host check

Fired after the CORS reachability check to the PostHog app.

PropertyTypeDescription
ui_hoststringHost being checked
api_hoststringAPI host for reference
ui_host_sourcestringHow the UI host was resolved
is_authenticatedbooleanAuth state at time of check
status'ok' | 'error'Check result
error_typestringOnly on error: timeout, network_or_cors, http_error, unknown
duration_msnumberTime taken for the check

File: toolbarConfigLogic.ts

Authentication

toolbar authenticate

Fired when the user triggers authentication.

PropertyTypeDescription
is_authenticatedbooleanAuth state when action was triggered

File: toolbarConfigLogic.ts

toolbar oauth exchange

Fired after an OAuth authorization code exchange attempt.

PropertyTypeDescription
status'success' | 'error' | 'network_error'Outcome of the exchange
duration_msnumberTime taken for the exchange
errorstringOnly on error status: error description

File: toolbarConfigLogic.ts

toolbar token refresh

Fired after a token refresh attempt (triggered automatically on 401 responses).

PropertyTypeDescription
status'success' | 'error'Outcome of the refresh
duration_msnumberTime taken for the refresh
http_statusnumberOnly on error: HTTP status code

File: toolbarAuth.ts

toolbar token expired

Fired when the OAuth token expires or a 403 is received. No properties.

File: toolbarConfigLogic.ts

toolbar logout

Fired when the user logs out from the toolbar. No properties.

File: toolbarConfigLogic.ts

toolbar ui host config modal opened

Fired when the UI host configuration modal is shown (auth error state).

PropertyTypeDescription
ui_hoststringCurrent UI host value

File: toolbarConfigLogic.ts

API requests

toolbar api request

Fired after every toolbarFetch call. Covers all toolbar API endpoints.

PropertyTypeDescription
methodstringHTTP method (GET, POST, PATCH, DELETE)
pathnamestringAPI path (e.g., /api/projects/@current/actions/)
statusnumberHTTP response status code
duration_msnumberTotal time including any token retry
did_token_retrybooleanWhether a 401 triggered a token refresh + retry

File: toolbarConfigLogic.ts

toolbar menu opened

Fired when a toolbar menu becomes visible.

PropertyTypeDescription
menuMenuStateMenu that was opened
previous_menuMenuStateMenu that was previously visible

File: bar/toolbarLogic.ts

toolbar menu closed

Fired when a toolbar menu is closed (state returns to 'none').

PropertyTypeDescription
menuMenuStateMenu that was closed

File: bar/toolbarLogic.ts

toolbar mode triggered

Fired when a toolbar mode is toggled on or off.

PropertyTypeDescription
modestringOne of: heatmap, inspect, actions, experiments, product-tours
enabledbooleanWhether the mode was enabled or disabled

Files: elements/elementsLogic.ts, elements/heatmapToolbarMenuLogic.ts, actions/actionsTabLogic.tsx, experiments/experimentsTabLogic.tsx, product-tours/productToursLogic.ts

Element inspection

toolbar selected HTML element

Fired when an element is selected in inspect mode.

PropertyTypeDescription
element_tagstring | nullHTML tag name
element_typestring | nulltype attribute value
has_hrefbooleanWhether element has an href
has_classbooleanWhether element has classes
has_idbooleanWhether element has an id
has_namebooleanWhether element has a name attribute
has_data_attrbooleanWhether element has data attributes
data_attributesstring[]List of data attribute names

File: elements/elementsLogic.ts

Actions

toolbar_manual_selector_modal_opened

Fired when the manual CSS selector editing modal is opened.

PropertyTypeDescription
selectorstring | nullCurrent selector being edited

File: actions/ActionsEditingToolbarMenu.tsx

toolbar_manual_selector_applied

Fired when a user applies a manual CSS selector.

PropertyTypeDescription
chosenSelectorstringThe selector that was applied

File: actions/ActionsEditingToolbarMenu.tsx

Feature flags

toolbar feature flag overridden

Fired when a feature flag override is applied. No properties.

File: flags/flagsToolbarLogic.ts

toolbar feature flag override removed

Fired when a feature flag override is removed. No properties.

File: flags/flagsToolbarLogic.ts

toolbar flags impersonated

Fired when flags are loaded for a different distinct ID.

PropertyTypeDescription
distinct_idstringThe distinct ID being impersonated

File: flags/flagsToolbarLogic.ts

Product tours

product tour recording started

Fired when session recording starts for product tour editing. No properties.

File: product-tours/productToursLogic.ts

product tour step added

Fired when a new step is added to a tour.

PropertyTypeDescription
step_typestringType of step added
step_indexnumberIndex of the new step
tour_idstring | nullID of the tour being edited

File: product-tours/productToursLogic.ts

product tour step removed

Fired when a step is removed from a tour.

PropertyTypeDescription
step_typestring | nullType of step removed
step_indexnumberIndex of the removed step
tour_idstring | nullID of the tour
remaining_stepsnumberSteps remaining after removal

File: product-tours/productToursLogic.ts

Fired when the user selects session recording consent.

PropertyTypeDescription
consentbooleanWhether consent was given

File: product-tours/productToursLogic.ts

product tour preview started

Fired when the user starts previewing a product tour.

PropertyTypeDescription
tour_idstring | nullID of the tour being previewed
step_countnumberNumber of steps in the tour

File: product-tours/productToursLogic.ts

Screenshots

media preview uploaded

Fired after a successful screenshot/media upload.

PropertyTypeDescription
source'toolbar'Always 'toolbar'

File: screenshot-upload/screenshotUploadLogic.ts

Heatmap sampling (page's PostHog instance)

These events use the page's posthog.capture(), not toolbarPosthogJS. They are sent to the customer's project, not PostHog's internal project.

sampling_enabled_on_heatmap

Fired when sampling is enabled on the heatmap. No properties.

sampling_disabled_on_heatmap

Fired when sampling is disabled on the heatmap. No properties.

sampling_percentage_updated_on_heatmap

Fired when the sampling percentage is changed.

PropertyTypeDescription
samplingFactornumberNew sampling factor (e.g., 0.1, 0.25, 0.5)

File: stats/HeatmapToolbarMenu.tsx