Add event tracking for topic load
This commit is contained in:
1 parent
5fe506324a
commit
d3578756d4
2 files changed
+25
-2
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user