added Analytics

This commit is contained in:
planetabhi
2024-12-16 14:25:30 +05:30
parent 4fc6879168
commit 320655d46e
4 changed files with 41 additions and 1 deletions

View File

@@ -2,8 +2,18 @@ import { defineConfig } from 'astro/config';
import react from "@astrojs/react";
import netlify from "@astrojs/netlify";
import partytown from "@astrojs/partytown";
export default defineConfig({
integrations: [react()],
integrations: [
react(),
partytown(
{
config: {
forward: ["dataLayer.push"],
},
}
)],
output: "server",
adapter: netlify()

View File

@@ -18,6 +18,7 @@
},
"dependencies": {
"@astrojs/netlify": "^6.0.0",
"@astrojs/partytown": "^2.1.2",
"@astrojs/react": "^4.1.0",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",

18
pnpm-lock.yaml generated
View File

@@ -11,6 +11,9 @@ importers:
'@astrojs/netlify':
specifier: ^6.0.0
version: 6.0.0(astro@5.0.5(rollup@4.28.1)(typescript@5.7.2))(rollup@4.28.1)
'@astrojs/partytown':
specifier: ^2.1.2
version: 2.1.2
'@astrojs/react':
specifier: ^4.1.0
version: 4.1.0(@types/react-dom@19.0.2(@types/react@19.0.1))(@types/react@19.0.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)
@@ -69,6 +72,9 @@ packages:
peerDependencies:
astro: ^5.0.0
'@astrojs/partytown@2.1.2':
resolution: {integrity: sha512-1a9T5lqxtnrw0qLPo1KwliUvaaUzPNPtWucD8VxdwT7zqcpODFk1RzGgAgqVo+YhutFrTu/qclbtnOfXBuskjw==}
'@astrojs/prism@3.2.0':
resolution: {integrity: sha512-GilTHKGCW6HMq7y3BUv9Ac7GMe/MO9gi9GW62GzKtth0SwukCu/qp2wLiGpEujhY+VVhaG9v7kv/5vFzvf4NYw==}
engines: {node: ^18.17.1 || ^20.3.0 || >=22.0.0}
@@ -168,6 +174,11 @@ packages:
resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==}
engines: {node: '>=6.9.0'}
'@builder.io/partytown@0.10.2':
resolution: {integrity: sha512-A9U+4PREWcS+CCYzKGIPovtGB/PBgnH/8oQyCE6Nr9drDJk6cMPpLQIEajpGPmG9tYF7N3FkRvhXm/AS9+0iKg==}
engines: {node: '>=18.0.0'}
hasBin: true
'@emnapi/runtime@1.3.1':
resolution: {integrity: sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==}
@@ -2083,6 +2094,11 @@ snapshots:
- tsx
- yaml
'@astrojs/partytown@2.1.2':
dependencies:
'@builder.io/partytown': 0.10.2
mrmime: 2.0.0
'@astrojs/prism@3.2.0':
dependencies:
prismjs: 1.29.0
@@ -2234,6 +2250,8 @@ snapshots:
'@babel/helper-string-parser': 7.25.9
'@babel/helper-validator-identifier': 7.25.9
'@builder.io/partytown@0.10.2': {}
'@emnapi/runtime@1.3.1':
dependencies:
tslib: 2.8.1

View File

@@ -36,6 +36,17 @@ const { site, title, tagline } = Astro.props;
/>
<meta property="og:url" content="https://riseofmachine.com/" />
<meta name="twitter:card" content="summary_large_image" />
<!-- Google tag (gtag.js) -->
<script type="text/partytown" async src="https://www.googletagmanager.com/gtag/js?id=G-S08Z38BTMJ"></script>
<script type="text/partytown">
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-S08Z38BTMJ');
</script>
</head>
<body>