Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
951225b
Tests first: OpenBot for Business opened and booked are counted in th…
ACl365 Dec 2, 2026
0ffb75e
Count OpenBot for Business opened and booked in the app
ACl365 Dec 2, 2026
a4a28c0
Tests first: Book a demo on onboarding's step is its opening
ACl365 Dec 2, 2026
991bfac
Book a demo on onboarding's step counts as its opening
ACl365 Dec 2, 2026
2e31242
Merge remote-tracking branch 'origin/main' into alex/2026-12-02/busin…
ACl365 Dec 2, 2026
63fee6c
Tests: drawing the dialog again builds a fresh tree
ACl365 Dec 2, 2026
8acbba1
Tests first: the opening's place holds for the dialog's life
ACl365 Dec 2, 2026
261239c
The opening's place holds while the OpenBot for Business dialog is open
ACl365 Dec 2, 2026
9c8dcc3
Tests: every signed-in entry's opening, calendar tag and booking name…
ACl365 Dec 2, 2026
7235444
Tests: onboarding's OpenBot for Business step counts only Book a demo…
ACl365 Dec 2, 2026
900082a
BusinessAction is the spec's BusinessEvent action
ACl365 Dec 2, 2026
d1f73a5
docs: what an OpenBot for Business count is, exactly
ACl365 Dec 2, 2026
ae819b6
Tests first: switching organization closes the OpenBot for Business d…
ACl365 Dec 2, 2026
677b104
Switching organization closes the OpenBot for Business dialog before …
ACl365 Dec 2, 2026
75183a9
Tests: the team features dialog's tests answer the opening's count
ACl365 Dec 2, 2026
2e47a88
Merge remote-tracking branch 'origin/main' into alex/2026-12-02/busin…
ACl365 Dec 2, 2026
6b35553
Tests: the entries' own tests answer the opening's count
ACl365 Dec 2, 2026
8833e24
docs: the OpenBot that Desktop runs on this computer, in the opt-out …
ACl365 Dec 2, 2026
1adf8aa
Merge remote-tracking branch 'origin/main' into alex/2026-12-03/busin…
ACl365 Dec 3, 2026
5afa133
API: the server counts one OpenBot for Business opened and booked per…
ACl365 Dec 3, 2026
ef0fcdb
docs: an OpenBot for Business event id is the person, organization, a…
ACl365 Dec 3, 2026
99c12fd
Merge remote-tracking branch 'origin/main' into alex/2026-12-03/busin…
ACl365 Dec 3, 2026
2c43e42
Merge remote-tracking branch 'origin/main' into alex/2026-12-03/busin…
ACl365 Dec 4, 2026
0773709
API: each accepted OpenBot for Business report is sent, and its id re…
ACl365 Dec 4, 2026
e84462b
docs: an OpenBot for Business event id's exact form, one clock readin…
ACl365 Dec 4, 2026
43275e2
Merge remote-tracking branch 'origin/main' into alex/2026-12-03/busin…
ACl365 Dec 4, 2026
39a310e
docs: an OpenBot for Business event id is pseudonymous, not secret: e…
ACl365 Dec 4, 2026
8cd96a3
Merge main into business-once-a-day
ACl365 Dec 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22580,6 +22580,55 @@ paths:
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/UnexpectedError'
/api/v2/organizations/{organizationId}/business-events:
parameters:
- $ref: '#/components/parameters/OrganizationId'
post:
tags:
- Product events
operationId: recordBusinessEvent
summary: Record the caller opening OpenBot for Business, or booking a call in it
description: 'Tell OpenBot that the caller opened OpenBot for Business in the app, or booked a call in its calendar, and from which screen. The booking itself is Calendly''s record, which keeps the same screen as its `utm_content`; this counts the opening and the booking by that place, so the two read together. It is best effort: a client sends one per opening or booking and waits on nothing. Each accepted report is sent, and its event id repeats for the same person, organization, place, surface and UTC day, so distinct ids count each once a day; Calendly''s records stay the count of bookings. The event counts for the caller and names nothing else: never the time booked or anything typed into the calendar. Where this OpenBot has product telemetry switched off, it is accepted and dropped.'
security:
- webSession: []
- appOAuth:
- conversations:write
- apiKey: []
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BusinessEvent'
examples:
opened:
$ref: '#/components/examples/BusinessOpened'
responses:
'204':
description: The event is accepted.
headers:
X-Request-Id:
$ref: '#/components/headers/RequestId'
'400':
$ref: '#/components/responses/InvalidRequest'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/Forbidden'
'404':
$ref: '#/components/responses/OrganizationNotFound'
'409':
$ref: '#/components/responses/IdempotencyConflict'
'413':
$ref: '#/components/responses/PayloadTooLarge'
'429':
$ref: '#/components/responses/TooManyRequests'
'500':
$ref: '#/components/responses/ServerError'
default:
$ref: '#/components/responses/UnexpectedError'
/api/v2/organizations/{organizationId}/settings/learning:
parameters:
- $ref: '#/components/parameters/OrganizationId'
Expand Down Expand Up @@ -47263,6 +47312,37 @@ components:
- web
- desktop
description: Where the caller saw or answered it.
BusinessEvent:
type: object
description: What the caller did with OpenBot for Business in the app, and where. Names nothing about the person, who is the caller, and nothing about the call booked.
additionalProperties: false
required:
- action
- place
- surface
properties:
action:
type: string
enum:
- opened
- booked
description: 'opened when one of the app''s entries opened OpenBot for Business, or Book a demo put the calendar on onboarding''s step; booked when its calendar said a call was booked in it: Calendly''s own message, from Calendly''s origin and the calendar''s frame.'
place:
type: string
enum:
- account_menu
- home
- admin
- computer_line
- self_host_banner
- onboarding
description: 'The screen that put OpenBot for Business in front of the caller, as its calendar''s `utm_content` names it: account_menu for the account menu''s entry, home for the home page''s Meet OpenBot for Business, admin for an Admin page that applies only to a team, computer_line for a Bot''s line about a computer of its own, self_host_banner for the self-hosting bar''s Book a call, and onboarding for onboarding''s Book a demo step. OpenBot Cloud''s sign-in screen is not one: nobody is signed in there.'
surface:
type: string
enum:
- web
- desktop
description: Where the caller opened it or booked, in a browser or in OpenBot Desktop's window.
LearningSpaceId:
type: string
description: A Learning space's id in the backend (its container).
Expand Down Expand Up @@ -64897,6 +64977,12 @@ components:
action: clicked
place: card
surface: desktop
BusinessOpened:
summary: The caller opened OpenBot for Business from the account menu, in OpenBot Desktop.
value:
action: opened
place: account_menu
surface: desktop
LearningConfigurationExample:
summary: Learning on, every Bot learning into the space OpenBot assigned, people reviewing their own.
value:
Expand Down
1 change: 1 addition & 0 deletions api/openapi/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ paths:
/api/v2/organizations/{organizationId}/app-errors: { $ref: './conversations.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1app-errors' }
/api/v2/app-errors: { $ref: './conversations.yaml#/paths/~1api~1v2~1app-errors' }
/api/v2/organizations/{organizationId}/nudge-events: { $ref: './conversations.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1nudge-events' }
/api/v2/organizations/{organizationId}/business-events: { $ref: './conversations.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1business-events' }
/api/v2/organizations/{organizationId}/settings/learning: { $ref: './learning.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1settings~1learning' }
/api/v2/organizations/{organizationId}/settings/learning/create-container: { $ref: './learning.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1settings~1learning~1create-container' }
/api/v2/organizations/{organizationId}/settings/learning/overview: { $ref: './learning.yaml#/paths/~1api~1v2~1organizations~1{organizationId}~1settings~1learning~1overview' }
Expand Down
111 changes: 111 additions & 0 deletions api/openapi/conversations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2221,6 +2221,67 @@ paths:
$ref: './common.yaml#/components/responses/ServerError'
default:
$ref: './common.yaml#/components/responses/UnexpectedError'
/api/v2/organizations/{organizationId}/business-events:
parameters:
- $ref: './common.yaml#/components/parameters/OrganizationId'
post:
tags:
- Product events
operationId: recordBusinessEvent
summary: Record the caller opening OpenBot for Business, or booking a call in it
description: >-
Tell OpenBot that the caller opened OpenBot for Business in the app,
or booked a call in its calendar, and from which screen. The booking
itself is Calendly's record, which keeps the same screen as its
`utm_content`; this counts the opening and the booking by that place,
so the two read together. It is best effort: a client sends one per
opening or booking and waits on nothing. Each accepted report is
sent, and its event id repeats for the same person, organization,
place, surface and UTC day, so distinct ids count each once a day;
Calendly's records stay the count of bookings. The event counts for the
caller and names nothing else: never the time booked or anything
typed into the calendar. Where this OpenBot has product telemetry
switched off, it is accepted and dropped.
security:
- webSession: []
- appOAuth:
- conversations:write
- apiKey: []
parameters:
- $ref: './common.yaml#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/BusinessEvent'
examples:
opened:
$ref: '#/components/examples/BusinessOpened'
responses:
'204':
description: The event is accepted.
headers:
X-Request-Id:
$ref: './common.yaml#/components/headers/RequestId'
'400':
$ref: './common.yaml#/components/responses/InvalidRequest'
'401':
$ref: './common.yaml#/components/responses/Unauthenticated'
'403':
$ref: './common.yaml#/components/responses/Forbidden'
'404':
$ref: './common.yaml#/components/responses/OrganizationNotFound'
'409':
$ref: './common.yaml#/components/responses/IdempotencyConflict'
'413':
$ref: './common.yaml#/components/responses/PayloadTooLarge'
'429':
$ref: './common.yaml#/components/responses/TooManyRequests'
'500':
$ref: './common.yaml#/components/responses/ServerError'
default:
$ref: './common.yaml#/components/responses/UnexpectedError'
components:
parameters:
ConversationLimit:
Expand Down Expand Up @@ -2782,6 +2843,53 @@ components:
- web
- desktop
description: Where the caller saw or answered it.
BusinessEvent:
type: object
description: >-
What the caller did with OpenBot for Business in the app, and where.
Names nothing about the person, who is the caller, and nothing about
the call booked.
additionalProperties: false
required:
- action
- place
- surface
properties:
action:
type: string
enum:
- opened
- booked
description: >-
opened when one of the app's entries opened OpenBot for Business,
or Book a demo put the calendar on onboarding's step; booked when
its calendar said a call was booked in it: Calendly's own message,
from Calendly's origin and the calendar's frame.
place:
type: string
enum:
- account_menu
- home
- admin
- computer_line
- self_host_banner
- onboarding
description: >-
The screen that put OpenBot for Business in front of the caller,
as its calendar's `utm_content` names it: account_menu for the
account menu's entry, home for the home page's Meet OpenBot for
Business, admin for an Admin page that applies only to a team,
computer_line for a Bot's line about a computer of its own,
self_host_banner for the self-hosting bar's Book a call, and
onboarding for onboarding's Book a demo step. OpenBot Cloud's
sign-in screen is not one: nobody is signed in there.
surface:
type: string
enum:
- web
- desktop
description: Where the caller opened it or booked, in a browser or in
OpenBot Desktop's window.
AppError:
type: object
description: An error the app hit and did not handle, as the app saw it.
Expand Down Expand Up @@ -4205,6 +4313,9 @@ components:
NudgeClicked:
summary: "The caller opened OpenBot's repository from the star card, in OpenBot Desktop."
value: {"nudge": "star-on-github", "action": "clicked", "place": "card", "surface": "desktop"}
BusinessOpened:
summary: "The caller opened OpenBot for Business from the account menu, in OpenBot Desktop."
value: {"action": "opened", "place": "account_menu", "surface": "desktop"}
AppErrorBoundary:
summary: "An error the web app's error screen caught."
value: {"source": "error_boundary", "type": "TypeError", "message": "Cannot read properties of undefined (reading 'title')", "stack": "TypeError: Cannot read properties of undefined (reading 'title')\n at BotCard (/assets/route-app-secondary.js:12:345)", "surface": "web", "appVersion": "1.1.0-rc.2"}
35 changes: 31 additions & 4 deletions app/src/components/edition/team-features-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ import type { NavigationItem } from "@/lib/navigation";
import {
type AppBusinessPlace,
BUSINESS_URL,
recordBusiness,
} from "@/lib/openbot-for-business";
import { onOrganizationChange } from "@/lib/organizations/current";
import { cn } from "@/lib/utils";
import {
BOOK_A_DEMO_LINE,
Expand Down Expand Up @@ -91,8 +93,9 @@ export const TEAM_FEATURES = TEAM_FEATURE_GROUPS.flatMap(
* skin (the navigation, the home page's link, a Bot's computer line, the self-host banner) can open
* it without a provider of its own.
*
* With where it was opened from, which its calendar is tagged with and counts (`BookingCalendar`).
* The calendar is drawn only while the dialog is open, so it reads the entry that opened it.
* With where it was opened from, which its calendar is tagged with (`BookingCalendar`) and the
* opening and a call booked in it are counted by (`recordBusiness`). The calendar is drawn only
* while the dialog is open, so it reads the entry that opened it.
*/
let open = false;
let openedFrom: AppBusinessPlace = "account_menu";
Expand All @@ -103,7 +106,24 @@ function setOpen(next: boolean) {
for (const listener of listeners) listener();
}

/*
* Closed when the person starts working in another organization, before React draws it. The layout
* holding the dialog is built again for the new one (`OrganizationBoundary`), and its copy read this
* flag still open: it drew the dialog, with a calendar of its own that counted a booking there, until
* the old copy's unmount closed it a moment later. The same organization again is no change.
*/
onOrganizationChange(() => setOpen(false));

/*
* The opening is counted here, as the entry is pressed, and never as the dialog draws: so StrictMode's
* second run of an effect, or the dialog drawn again, counts nothing more. Closed and opened again is
* a new opening; an entry reached while the dialog is already open is not, and changes nothing: the
* place stays the first entry's for the dialog's life, so its count, its calendar's `utm_content` and
* a call booked in it name the same entry, even when a second is reached before the dialog draws.
*/
export function openTeamFeatures(from: AppBusinessPlace) {
if (open) return;
void recordBusiness("opened", from);
openedFrom = from;
setOpen(true);
}
Expand Down Expand Up @@ -187,8 +207,15 @@ function BookDemo() {
const [place] = useState(() => openedFrom);
const [failed, setFailed] = useState(false);
const fail = useCallback(() => setFailed(true), []);
// Calendly shows its own confirmation in the frame; there is nothing more to say here.
const booked = useCallback(() => {}, []);
/*
* Calendly shows its own confirmation in the frame; there is nothing more to say here, only the
* call to count, by the entry that opened the dialog. `BookingCalendar` calls this only for
* Calendly's own message, from its origin and this calendar's frame.
*/
const booked = useCallback(
() => void recordBusiness("booked", place),
[place],
);
return (
<section
aria-labelledby="book-a-demo-title"
Expand Down
18 changes: 18 additions & 0 deletions app/src/lib/api/generated/model/businessEvent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`.
*/
import type { BusinessEventAction } from "./businessEventAction";
import type { BusinessEventPlace } from "./businessEventPlace";
import type { BusinessEventSurface } from "./businessEventSurface";

/**
* What the caller did with OpenBot for Business in the app, and where. Names nothing about the person, who is the caller, and nothing about the call booked.
*/
export interface BusinessEvent {
/** opened when one of the app's entries opened OpenBot for Business, or Book a demo put the calendar on onboarding's step; booked when its calendar said a call was booked in it: Calendly's own message, from Calendly's origin and the calendar's frame. */
action: BusinessEventAction;
/** The screen that put OpenBot for Business in front of the caller, as its calendar's `utm_content` names it: account_menu for the account menu's entry, home for the home page's Meet OpenBot for Business, admin for an Admin page that applies only to a team, computer_line for a Bot's line about a computer of its own, self_host_banner for the self-hosting bar's Book a call, and onboarding for onboarding's Book a demo step. OpenBot Cloud's sign-in screen is not one: nobody is signed in there. */
place: BusinessEventPlace;
/** Where the caller opened it or booked, in a browser or in OpenBot Desktop's window. */
surface: BusinessEventSurface;
}
14 changes: 14 additions & 0 deletions app/src/lib/api/generated/model/businessEventAction.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`.
*/

/**
* opened when one of the app's entries opened OpenBot for Business, or Book a demo put the calendar on onboarding's step; booked when its calendar said a call was booked in it: Calendly's own message, from Calendly's origin and the calendar's frame.
*/
export type BusinessEventAction =
(typeof BusinessEventAction)[keyof typeof BusinessEventAction];

export const BusinessEventAction = {
opened: "opened",
booked: "booked",
} as const;
18 changes: 18 additions & 0 deletions app/src/lib/api/generated/model/businessEventPlace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`.
*/

/**
* The screen that put OpenBot for Business in front of the caller, as its calendar's `utm_content` names it: account_menu for the account menu's entry, home for the home page's Meet OpenBot for Business, admin for an Admin page that applies only to a team, computer_line for a Bot's line about a computer of its own, self_host_banner for the self-hosting bar's Book a call, and onboarding for onboarding's Book a demo step. OpenBot Cloud's sign-in screen is not one: nobody is signed in there.
*/
export type BusinessEventPlace =
(typeof BusinessEventPlace)[keyof typeof BusinessEventPlace];

export const BusinessEventPlace = {
account_menu: "account_menu",
home: "home",
admin: "admin",
computer_line: "computer_line",
self_host_banner: "self_host_banner",
onboarding: "onboarding",
} as const;
14 changes: 14 additions & 0 deletions app/src/lib/api/generated/model/businessEventSurface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Generated by Orval from api/openapi.yaml. Do not edit: change the spec and run `bun run api:generate`.
*/

/**
* Where the caller opened it or booked, in a browser or in OpenBot Desktop's window.
*/
export type BusinessEventSurface =
(typeof BusinessEventSurface)[keyof typeof BusinessEventSurface];

export const BusinessEventSurface = {
web: "web",
desktop: "desktop",
} as const;
5 changes: 5 additions & 0 deletions app/src/lib/api/generated/model/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ export * from "./bugReportReporter";
export * from "./bugReportStatus";
export * from "./bugReportsUnavailableResponse";
export * from "./bundlePart";
export * from "./businessEvent";
export * from "./businessEventAction";
export * from "./businessEventPlace";
export * from "./businessEventSurface";
export * from "./callArtifactPageAppActionHeaders";
export * from "./callArtifactPageAppActionRequest";
export * from "./callArtifactPageAppActionRequestArgs";
Expand Down Expand Up @@ -1498,6 +1502,7 @@ export * from "./recheckConnectionHeaders";
export * from "./recheckSharedConnectionHeaders";
export * from "./reconnectApp";
export * from "./recordAppErrorHeaders";
export * from "./recordBusinessEventHeaders";
export * from "./recordConversationActivityHeaders";
export * from "./recorderActivity";
export * from "./recorderActivityPhase";
Expand Down
Loading
Loading