Sfoglia il codice sorgente

Add gtag to history

main
Steve Ruiz 4 anni fa
parent
commit
6711f980d8
1 ha cambiato i file con 8 aggiunte e 0 eliminazioni
  1. 8
    0
      state/history.ts

+ 8
- 0
state/history.ts Vedi File

@@ -1,4 +1,5 @@
1 1
 import { Data } from 'types'
2
+import * as gtag from 'utils/gtag'
2 3
 import { BaseCommand } from './commands/command'
3 4
 import storage from './storage'
4 5
 
@@ -11,6 +12,13 @@ class History<T extends Data> {
11 12
   private _enabled = true
12 13
 
13 14
   execute = (data: T, command: BaseCommand<T>) => {
15
+    gtag.event({
16
+      action: command.name,
17
+      category: command.category,
18
+      label: '',
19
+      value: 0,
20
+    })
21
+
14 22
     command.redo(data, true)
15 23
 
16 24
     if (this.disabled) return

Loading…
Annulla
Salva