mirror of
https://github.com/alexandrev/xslt-lab.git
synced 2026-09-18 19:43:16 +00:00
Add Google Analytics integration
This commit is contained in:
+23
-12
@@ -22,18 +22,29 @@
|
||||
<meta property="og:image" content="/logo.svg" />
|
||||
<link rel="canonical" href="https://xsltplayground.com/" />
|
||||
<script type="module" src="/env.js"></script>
|
||||
<script>
|
||||
if (window.env && window.env.VITE_ADSENSE_CLIENT) {
|
||||
const s = document.createElement('script');
|
||||
s.async = true;
|
||||
s.src =
|
||||
'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=' +
|
||||
window.env.VITE_ADSENSE_CLIENT;
|
||||
s.crossOrigin = 'anonymous';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<script>
|
||||
if (window.env && window.env.VITE_ADSENSE_CLIENT) {
|
||||
const s = document.createElement('script');
|
||||
s.async = true;
|
||||
s.src =
|
||||
'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=' +
|
||||
window.env.VITE_ADSENSE_CLIENT;
|
||||
s.crossOrigin = 'anonymous';
|
||||
document.head.appendChild(s);
|
||||
}
|
||||
if (window.env && window.env.VITE_GA_ID) {
|
||||
const g = document.createElement('script');
|
||||
g.async = true;
|
||||
g.src =
|
||||
'https://www.googletagmanager.com/gtag/js?id=' + window.env.VITE_GA_ID;
|
||||
document.head.appendChild(g);
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', window.env.VITE_GA_ID);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.jsx"></script>
|
||||
|
||||
Reference in New Issue
Block a user