Skip to content

Commit

Permalink
Merge pull request #18 from DemocraciaEnRed/main
Browse files Browse the repository at this point in the history
Deploy!
  • Loading branch information
mpvaldez authored May 10, 2024
2 parents fdbb71b + a2c4d4c commit c97044f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/app/components/GoogleAnalytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@ const GoogleAnalytics = () => {
}

return (
<Script
strategy="afterInteractive" // Load the script after interactive content is available
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
/>
<>
<Script
strategy="afterInteractive"
src={`https://www.googletagmanager.com/gtag/js?id=${GA_TRACKING_ID}`}
/>
<Script id="gtag" strategy="afterInteractive">
{`
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '${GA_TRACKING_ID}');
`}
</Script>
</>

);
};

Expand Down

0 comments on commit c97044f

Please sign in to comment.