Skip to content

Commit 151b86e

Browse files
committed
Upgrade analytics
1 parent 0df283a commit 151b86e

File tree

2 files changed

+35
-34
lines changed

2 files changed

+35
-34
lines changed

docs/App.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const handleClick = btn => {
1616
selected = btn.name
1717
code = btn.code
1818
btn.run()
19+
gtag('event', 'toast', { event_label: btn.name })
1920
}
2021
2122
const buttons = [

docs/index.html

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4-
<meta charset="utf-8">
5-
<meta name="viewport" content="width=device-width,initial-scale=1">
6-
<title>svelte-toast | DEMO</title>
7-
<meta name="description" content="Simple elegant toast notifications. Use it in Vanilla JS or as a Svelte component.">
8-
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<title>svelte-toast | DEMO</title>
7+
<meta name="description" content="Simple elegant toast notifications. Use it in Vanilla JS or as a Svelte component.">
8+
<script>
9+
window.dataLayer = window.dataLayer || []
10+
function gtag () { dataLayer.push(arguments) }
11+
gtag('js', new Date())
12+
gtag('config', 'G-G9JC5N7N1H')
13+
location.protocol === 'https:' && (function () {
14+
const script = document.createElement('script')
15+
script.async = true
16+
script.src = 'https://www.googletagmanager.com/gtag/js?id=G-G9JC5N7N1H'
17+
document.head.appendChild(script)
18+
}())
19+
</script>
20+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
921
<link rel="stylesheet" href="build/global.css">
1022
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.23.0/themes/prism-tomorrow.min.css">
11-
<script defer src="build/bundle.js"></script>
12-
<script>
13-
(function(){
14-
if (location.protocol === 'https:') {
15-
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
16-
ga('create', 'UA-66946548-3', 'auto');
17-
ga('send', 'pageview');
18-
var el = document.createElement('script');
19-
el.src = 'https://www.google-analytics.com/analytics.js';
20-
document.head.appendChild(el);
21-
}
22-
}());
23-
</script>
23+
<script defer src="build/bundle.js"></script>
2424
</head>
2525

2626
<body class="pt-8 pb-16">
27-
<h1 class="text-4xl text-center">svelte-toast</h1>
28-
<div class="h-16 flex flex-col items-center">
29-
<a
30-
href="https://github.com/zerodevx/svelte-toast"
31-
title="Fork me on Github">
32-
<img
33-
class="opacity-97 hover:opacity-75"
34-
src="https://img.shields.io/github/package-json/v/zerodevx/svelte-toast?logo=github&style=for-the-badge&color=blue"
35-
alt="@zerodevx">
36-
</a>
37-
</div>
38-
<p class="container px-2 mb-4">
39-
Simple, elegant, generic, flexible and performant toast notifications.
40-
Because a demo helps better than a thousand API docs, so here it is.
41-
Use in Vanilla JS (6kb gzipped) or as a Svelte component.
42-
</p>
27+
<h1 class="text-4xl text-center">svelte-toast</h1>
28+
<div class="h-16 flex flex-col items-center">
29+
<a
30+
href="https://github.com/zerodevx/svelte-toast"
31+
title="Fork me on Github">
32+
<img
33+
class="opacity-97 hover:opacity-75"
34+
src="https://img.shields.io/github/package-json/v/zerodevx/svelte-toast?logo=github&style=for-the-badge&color=blue"
35+
alt="@zerodevx">
36+
</a>
37+
</div>
38+
<p class="container px-2 mb-4">
39+
Simple, elegant, generic, flexible and performant toast notifications.
40+
Because a demo helps better than a thousand API docs, so here it is.
41+
Use in Vanilla JS (6kb gzipped) or as a Svelte component.
42+
</p>
4343
</body>
4444
</html>

0 commit comments

Comments
 (0)