File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 99
1010 function enableAnalytics() {
1111 // @ts-ignore
12- window .dataLayer = window .dataLayer || [];
13- function gtag(... args : any []) {
14- // @ts-ignore
15- window .dataLayer .push (args );
16- }
17- gtag (' js' , new Date ());
12+ window .dataLayer = [
13+ {
14+ ' gtm.start' : new Date ().getTime (),
15+ event: ' gtm.js'
16+ }
17+ ];
18+
19+ var script = document .createElement (' script' );
20+ script .async = true ;
21+ script .src = ' https://www.googletagmanager.com/gtm.js?id=' + RV_GOOGLE_TAG_MANAGER_ID ;
1822
19- const script = document .createElement (' script' );
20- script .src = ` https://www.googletagmanager.com/gtm.js?id=${RV_GOOGLE_TAG_MANAGER_ID } ` ;
21- document .head .append (script );
23+ // @ts-ignore
24+ document .getElementsByTagName (' script' )[0 ].parentNode .insertBefore (script , firstScript );
2225 }
2326
2427 function handleConsent(allowed : boolean ) {
You can’t perform that action at this time.
0 commit comments