Skip to content

Commit c97044f

Browse files
authoredMay 10, 2024··
Merge pull request #18 from DemocraciaEnRed/main
Deploy!
2 parents fdbb71b + a2c4d4c commit c97044f

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed
 

‎src/app/components/GoogleAnalytics.tsx

+15-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,21 @@ const GoogleAnalytics = () => {
88
}
99

1010
return (
11-
<Script
12-
strategy="afterInteractive" // Load the script after interactive content is available
13-
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
14-
/>
11+
<>
12+
<Script
13+
strategy="afterInteractive"
14+
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
15+
/>
16+
<Script id="gtag" strategy="afterInteractive">
17+
{`
18+
window.dataLayer = window.dataLayer || [];
19+
function gtag(){dataLayer.push(arguments);}
20+
gtag('js', new Date());
21+
gtag('config', '${GA_TRACKING_ID}');
22+
`}
23+
</Script>
24+
</>
25+
1526
);
1627
};
1728

0 commit comments

Comments
 (0)
Please sign in to comment.