mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
Add analytics
This commit is contained in:
@@ -40,7 +40,7 @@ app.use(
|
||||
app.use(/^\/$/, async (req, res, next) => {
|
||||
let index = await fs.readFile('./docs/index.html', 'utf8');
|
||||
index = index
|
||||
.replace('</head>', '<script>window.ShoelaceDevServer = true;</script></head>')
|
||||
.replace('<head>', '<head><script>window.ShoelaceDevServer = true;</script>')
|
||||
.replace(
|
||||
'</body>',
|
||||
'<iframe src="/~dev-server" style="display: block; width: 0; height: 0; border: 0;"></iframe></body>'
|
||||
|
||||
@@ -18,6 +18,19 @@
|
||||
<!-- Import Shoelace -->
|
||||
<link rel="stylesheet" href="/dist/shoelace/shoelace.css" />
|
||||
<script type="module" src="/dist/shoelace/shoelace.esm.js"></script>
|
||||
|
||||
<!-- Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-6412891-16"></script>
|
||||
<script>
|
||||
if (!window.ShoelaceDevServer) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
gtag('js', new Date());
|
||||
gtag('config', 'UA-6412891-16');
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Reference in New Issue
Block a user