mirror of
https://github.com/storytold/placeholder-artcraft.git
synced 2026-10-28 08:56:48 +00:00
mirror repo (WIP)
Need to remove secrets before entire repo can be made public.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
export * from './lib/gtag-login.js';
|
||||
export * from './lib/gtag-logout.js';
|
||||
export * from './lib/gtag-event.js';
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
// Send an event with name and "args". Args is a string-to-string map.
|
||||
export const gtagEvent = function(eventName: string, args?: { [key: string]: string }) {
|
||||
console.debug("gtagEvent", eventName, args);
|
||||
if (!args) {
|
||||
(window as any).gtag('event', eventName);
|
||||
} else {
|
||||
(window as any).gtag('event', eventName, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { TAG_ID } from './tag-id.js';
|
||||
|
||||
export const gtagLogin = function(userToken: string) {
|
||||
console.debug("gtagLogin", TAG_ID, userToken);
|
||||
|
||||
(window as any).gtag(
|
||||
'config', TAG_ID, {
|
||||
'user_id': userToken
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { TAG_ID } from './tag-id.js';
|
||||
|
||||
export const gtagLogout = function() {
|
||||
console.debug("gtagLogout", TAG_ID);
|
||||
|
||||
(window as any).gtag(
|
||||
'config', TAG_ID, {
|
||||
'user_id': null
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export const TAG_ID = 'G-Y4Y8KMLPQ7';
|
||||
Reference in New Issue
Block a user