Skip to content

Commit adcd645

Browse files
author
Dustin Goodman
committed
fix landing page google analytics
1 parent 005e86b commit adcd645

File tree

6 files changed

+12
-71
lines changed

6 files changed

+12
-71
lines changed

packages/landing-site/src/pages/index.astro

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,18 @@ const contributorsData = await getContributorsData()
3131
<meta name="theme-color" content="#ffffff" />
3232
<meta charset="UTF-8" />
3333
{
34-
import.meta.env.VITE_ENVIRONMENT === 'production' && (
35-
<>
36-
<Fragment
37-
set:html={`<script async src="https://www.googletagmanager.com/gtag/js?id=${
38-
import.meta.env.VITE_GOOGLE_ANALYTICS
39-
}"></script>`}
40-
/>
41-
<Fragment
42-
set:html={`<script>
43-
window.dataLayer = window.dataLayer || [];
44-
function gtag(){dataLayer.push(arguments);}
45-
gtag('js', new Date());
46-
gtag('config', '${import.meta.env.VITE_GOOGLE_ANALYTICS}');
47-
</script>`}
48-
/>
49-
</>
34+
import.meta.env.MODE === 'production' && (
35+
<script
36+
is:inline
37+
async
38+
src={`https://www.googletagmanager.com/gtag/js?id=${import.meta.env.VITE_GOOGLE_ANALYTICS}`}>
39+
</script>
40+
<script is:inline>
41+
window.dataLayer = window.dataLayer || [];
42+
function gtag(){dataLayer.push(arguments);}
43+
gtag('js', new Date());
44+
gtag('config', '${import.meta.env.VITE_GOOGLE_ANALYTICS}');
45+
</script>
5046
)
5147
}
5248
</head>

plop-templates/color-scheme.hbs

Lines changed: 0 additions & 3 deletions
This file was deleted.

plop-templates/component.css.hbs

Lines changed: 0 additions & 4 deletions
This file was deleted.

plop-templates/component.hbs

Lines changed: 0 additions & 14 deletions
This file was deleted.

plop-templates/component.stories.hbs

Lines changed: 0 additions & 14 deletions
This file was deleted.

plop-templates/icon.hbs

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)