mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add additional telemetry events
Summary: The new events capture usage of forms, widgets, access rules, and onboarding tours and tips. Test Plan: Manual. Reviewers: dsagal Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D4189
This commit is contained in:
@@ -233,7 +233,7 @@ export function attachAppEndpoint(options: AttachOptions): void {
|
||||
const response = await fetch(formUrl, {
|
||||
headers: getTransitiveHeaders(req),
|
||||
});
|
||||
if (response.status === 200) {
|
||||
if (response.ok) {
|
||||
const html = await response.text();
|
||||
res.send(html);
|
||||
} else {
|
||||
|
||||
@@ -1540,6 +1540,13 @@ export class DocWorkerApi {
|
||||
SUCCESS_URL: redirectUrl,
|
||||
TITLE: `${section.title || tableName || tableId || 'Form'} - Grist`
|
||||
});
|
||||
this._grist.getTelemetry().logEvent(req, 'visitedForm', {
|
||||
full: {
|
||||
docIdDigest: activeDoc.docName,
|
||||
userId: req.userId,
|
||||
altSessionId: req.altSessionId,
|
||||
},
|
||||
});
|
||||
res.status(200).send(renderedHtml);
|
||||
})
|
||||
);
|
||||
@@ -2026,6 +2033,7 @@ export class DocWorkerApi {
|
||||
}
|
||||
|
||||
private async _removeDoc(req: Request, res: Response, permanent: boolean) {
|
||||
const mreq = req as RequestWithLogin;
|
||||
const scope = getDocScope(req);
|
||||
const docId = getDocId(req);
|
||||
if (permanent) {
|
||||
@@ -2045,6 +2053,13 @@ export class DocWorkerApi {
|
||||
// Permanently delete from database.
|
||||
const query = await this._dbManager.deleteDocument(scope);
|
||||
this._dbManager.checkQueryResult(query);
|
||||
this._grist.getTelemetry().logEvent(mreq, 'deletedDoc', {
|
||||
full: {
|
||||
docIdDigest: docId,
|
||||
userId: mreq.userId,
|
||||
altSessionId: mreq.altSessionId,
|
||||
},
|
||||
});
|
||||
await sendReply(req, res, query);
|
||||
} else {
|
||||
await this._dbManager.softDeleteDocument(scope);
|
||||
|
||||
Reference in New Issue
Block a user