mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat: Track events of pdf documents views
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
SALE_INVOICE_CREATED,
|
||||
SALE_INVOICE_DELETED,
|
||||
SALE_INVOICE_EDITED,
|
||||
SALE_INVOICE_PDF_VIEWED,
|
||||
SALE_INVOICE_VIEWED,
|
||||
} from '@/constants/event-tracker';
|
||||
|
||||
@@ -38,6 +39,10 @@ export class SaleInvoiceEventsTracker extends EventSubscriber {
|
||||
events.saleInvoice.onViewed,
|
||||
this.handleTrackViewedInvoiceEvent
|
||||
);
|
||||
bus.subscribe(
|
||||
events.saleInvoice.onPdfViewed,
|
||||
this.handleTrackPdfViewedInvoiceEvent
|
||||
);
|
||||
}
|
||||
|
||||
private handleTrackInvoiceCreatedEvent = ({
|
||||
@@ -77,4 +82,12 @@ export class SaleInvoiceEventsTracker extends EventSubscriber {
|
||||
properties: {},
|
||||
});
|
||||
};
|
||||
|
||||
private handleTrackPdfViewedInvoiceEvent = ({ tenantId }) => {
|
||||
this.posthog.trackEvent({
|
||||
distinctId: `tenant-${tenantId}`,
|
||||
event: SALE_INVOICE_PDF_VIEWED,
|
||||
properties: {},
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user