Add gtag to history
This commit is contained in:
parent
fd85e07728
commit
6711f980d8
1 changed files with 8 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
import { Data } from 'types'
|
import { Data } from 'types'
|
||||||
|
import * as gtag from 'utils/gtag'
|
||||||
import { BaseCommand } from './commands/command'
|
import { BaseCommand } from './commands/command'
|
||||||
import storage from './storage'
|
import storage from './storage'
|
||||||
|
|
||||||
|
@ -11,6 +12,13 @@ class History<T extends Data> {
|
||||||
private _enabled = true
|
private _enabled = true
|
||||||
|
|
||||||
execute = (data: T, command: BaseCommand<T>) => {
|
execute = (data: T, command: BaseCommand<T>) => {
|
||||||
|
gtag.event({
|
||||||
|
action: command.name,
|
||||||
|
category: command.category,
|
||||||
|
label: '',
|
||||||
|
value: 0,
|
||||||
|
})
|
||||||
|
|
||||||
command.redo(data, true)
|
command.redo(data, true)
|
||||||
|
|
||||||
if (this.disabled) return
|
if (this.disabled) return
|
||||||
|
|
Loading…
Reference in a new issue