File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ < script >
2
+ window . dataLayer = window . dataLayer || [ ] ;
3
+ function gtag ( ) { dataLayer . push ( arguments ) ; }
4
+ gtag ( 'consent' , 'default' , {
5
+ 'ad_user_data' : 'denied' ,
6
+ 'ad_personalization' : 'denied' ,
7
+ 'ad_storage' : 'denied' ,
8
+ 'analytics_storage' : 'granted' ,
9
+ 'wait_for_update' : 500 ,
10
+ } ) ;
11
+ gtag ( 'js' , new Date ( ) ) ;
12
+ gtag ( 'config' , 'G-1KX8P933JG' ) ;
13
+ </ script >
Original file line number Diff line number Diff line change
1
+ grantButton . addEventListener ( "click" , function ( ) {
2
+ localStorage . setItem ( "consentGranted" , "true" ) ;
3
+ function gtag ( ) { dataLayer . push ( arguments ) ; }
4
+
5
+ gtag ( 'consent' , 'update' , {
6
+ ad_user_data : 'granted' ,
7
+ ad_personalization : 'granted' ,
8
+ ad_storage : 'granted' ,
9
+ analytics_storage : 'granted'
10
+ } ) ;
11
+
12
+ // Load gtag.js script.
13
+ var gtagScript = document . createElement ( 'script' ) ;
14
+ gtagScript . async = true ;
15
+ gtagScript . src = 'https://www.googletagmanager.com/gtag/js?id=G-1KX8P933JG' ;
16
+
17
+ var firstScript = document . getElementsByTagName ( 'script' ) [ 0 ] ;
18
+ firstScript . parentNode . insertBefore ( gtagScript , firstScript ) ;
You can’t perform that action at this time.
0 commit comments