File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -23,3 +23,31 @@ export const onPreRenderHTML = ({getHeadComponents}) => {
23
23
}
24
24
} )
25
25
} ;
26
+
27
+ export const onRenderBody = ( { setHeadComponents } ) => {
28
+ setHeadComponents ( [
29
+ // Set up the data layer, enable privacy defaults
30
+ < script
31
+ key = "gtm-data-layer"
32
+ type = "text/javascript"
33
+ dangerouslySetInnerHTML = { {
34
+ __html : `
35
+ (function(w, l) {
36
+ w[l] = w[l] || [];
37
+ if(/in-app/.test(window.location.pathname)){
38
+ w[l].push({ 'disableDrift': 'true' })
39
+ }
40
+ w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' })
41
+ })(window, 'dataLayer');
42
+ ` ,
43
+ } }
44
+ /> ,
45
+ // Fetch Tag Manager
46
+ < script
47
+ key = "gtm-script"
48
+ src = { `https://www.googletagmanager.com/gtm.js?id=GTM-N72TJRH` }
49
+ async = { true }
50
+ /> ,
51
+ ] ) ;
52
+ } ;
53
+
You can’t perform that action at this time.
0 commit comments