MCPcopy Create free account
hub / github.com/emwalker/digraph / googleAnalytics

Function googleAnalytics

client/src/server/renderFullPage.ts:19–31  ·  view source on GitHub ↗
(gaId: string | null)

Source from the content-addressed store, hash-verified

17 : '')
18
19const googleAnalytics = (gaId: string | null) => {
20 if (!gaId) return ''
21
22 return `
23 <script async src="https://www.googletagmanager.com/gtag/js?id=${gaId}"></script>
24 <script>
25 window.dataLayer = window.dataLayer || [];
26 function gtag(){dataLayer.push(arguments);}
27 gtag('js', new Date());
28 gtag('config', '${gaId}');
29 </script>
30 `
31}
32
33type Variables = {
34 gaId: string | null,

Callers 1

templateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected