mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 07:10:41 +00:00
Track generator ID in custom dimension
Preparing to add back search parameters to share links
This commit is contained in:
@@ -6,6 +6,7 @@ export namespace Analytics {
|
||||
const DIM_VERSION = 3
|
||||
const DIM_LANGUAGE = 4
|
||||
const DIM_PREVIEW = 5
|
||||
const DIM_GENERATOR = 6
|
||||
|
||||
function event(category: string, action: string, label?: string) {
|
||||
ga('send', 'event', category, action, label)
|
||||
@@ -40,6 +41,11 @@ export namespace Analytics {
|
||||
event(ID_GENERATOR, 'set-preview', preview)
|
||||
}
|
||||
|
||||
export function setGenerator(generator: string) {
|
||||
dimension(DIM_GENERATOR, generator)
|
||||
console.log(generator)
|
||||
}
|
||||
|
||||
export function generatorEvent(action: string, label?: string) {
|
||||
event(ID_GENERATOR, action, label)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user