MCPcopy Index your code
hub / github.com/ShareDropio/sharedrop / contentFor

Function contentFor

lib/google-analytics/index.js:10–26  ·  view source on GitHub ↗
(type, config)

Source from the content-addressed store, hash-verified

8 },
9
10 contentFor(type, config) {
11 const id = config.googleAnalyticsId;
12
13 if (type === 'head' && id) {
14 return `
15 <script async src="https://www.googletagmanager.com/gtag/js?id=${id}"></script>
16 <script>
17 window.dataLayer = window.dataLayer || [];
18 function gtag(){dataLayer.push(arguments);}
19 gtag('js', new Date());
20 gtag('config', '${id}');
21 </script>
22 `;
23 }
24
25 return '';
26 },
27};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected