fix: analytics events

This commit is contained in:
Torsten Dittmann committed 2022-07-05 23:16:48 +02:00
1 parent 933817e133
commit e0093b581a
3 files changed
+26 -8

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ export const event: Action<HTMLElement, AnalyticsActionParam> = (node, param) =>
if (!isTrackingAllowed()) {
return;
}
console.log('asd');
node.addEventListener(param.event ?? 'click', () =>
gtag('event', param.name, {
...param.parameters,
@@ -12,7 +12,6 @@
TableRowLink
} from '$lib/elements/table';
import Create from './_createUser.svelte';
import type { Models } from '@aw-labs/appwrite-console';
import { goto } from '$app/navigation';
import { event } from '$lib/actions/analytics';
import { Pill } from '$lib/elements';
@@ -21,6 +20,7 @@
import { base } from '$app/paths';
import { usersList } from './store';
import { onMount } from 'svelte';
import type { Models } from '@aw-labs/appwrite-console';
let showCreate = false;
let search = '';
@@ -53,9 +53,18 @@
<Container>
<Search bind:search placeholder="Search Name, Email, or ID">
<Button on:click={() => (showCreate = true)}>
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create User</span>
</Button>
<span
use:event={{
name: 'console_users',
action: 'click_create',
parameters: {
type: 'user'
}
}}>
<Button on:click={() => (showCreate = true)}>
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create User</span>
</Button>
</span>
</Search>
{#if $usersList?.response?.total}
<Table>
@@ -48,9 +48,18 @@
<Container>
<Search bind:search placeholder="Search by Name">
<Button on:click={() => (showCreate = true)}>
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create Team</span>
</Button>
<span
use:event={{
name: 'console_users',
action: 'click_create',
parameters: {
type: 'team'
}
}}>
<Button on:click={() => (showCreate = true)}>
<span class="icon-plus" aria-hidden="true" /> <span class="text">Create Team</span>
</Button>
</span>
</Search>
{#if $teamsList?.response?.total}
<Table>