Add event tracking for topic load

This commit is contained in:
Kamran Ahmed committed 2023-03-16 00:53:02 +00:00
1 parent 5fe506324a
commit d3578756d4
2 files changed
+25 -2

No files matched your search

+6
View File
@@ -2,6 +2,8 @@ export {};
declare global {
interface Window {
// To selectively enable/disable debug logs
__DEBUG__: boolean;
gtag: any;
fireEvent: (props: GAEventType) => void;
}
@@ -27,6 +29,10 @@ window.fireEvent = (props: GAEventType) => {
return;
}
if (window.__DEBUG__) {
console.log('Analytics event fired', props);
}
window.gtag('event', action, {
event_category: category,
event_label: label,