mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
26 lines
538 B
Plaintext
26 lines
538 B
Plaintext
---
|
|
import { assertSecret } from '@blitzkit/core';
|
|
|
|
const PUBLIC_GOOGLE_TAG_MANAGER_ID = assertSecret(
|
|
import.meta.env.PUBLIC_GOOGLE_TAG_MANAGER_ID,
|
|
);
|
|
---
|
|
|
|
<script
|
|
is:inline
|
|
async
|
|
src={`https://www.googletagmanager.com/gtag/js?id=${PUBLIC_GOOGLE_TAG_MANAGER_ID}`}
|
|
></script>
|
|
|
|
<script is:inline define:vars={{ PUBLIC_GOOGLE_TAG_MANAGER_ID }}>
|
|
window.dataLayer = window.dataLayer || [];
|
|
|
|
function gtag() {
|
|
dataLayer.push(arguments);
|
|
}
|
|
|
|
gtag('js', new Date());
|
|
|
|
gtag('config', PUBLIC_GOOGLE_TAG_MANAGER_ID);
|
|
</script>
|