File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
styles/all/template/event Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ public function load_google_analytics()
8080 'GOOGLEANALYTICS_TAG ' => $ this ->config ['googleanalytics_tag ' ],
8181 'GOOGLEANALYTICS_USER_ID ' => $ this ->user ->data ['user_id ' ],
8282 'S_ANONYMIZE_IP ' => $ this ->config ['ga_anonymize_ip ' ],
83+ 'S_COOKIE_SECURE ' => $ this ->config ['cookie_secure ' ],
8384 ]);
8485 }
8586
Original file line number Diff line number Diff line change 1313 { % - EVENT phpbb_googleanalytics_gtag_options - % }
1414 { % - if S_REGISTERED_USER % } 'user_id' : '{{ GOOGLEANALYTICS_USER_ID }}' , { % endif - % }
1515 { % - if S_ANONYMIZE_IP % } 'anonymize_ip' : true , { % endif - % }
16+ { % - if S_COOKIE_SECURE - % } 'cookie_flags' : 'samesite=none;secure' , { % - endif - % }
1617 } ) ;
1718 </ script >
1819 {% else %}
2526 ga ( 'create' , '{{ GOOGLEANALYTICS_ID }}' , 'auto' ) ;
2627 { % if S_REGISTERED_USER % } ga ( 'set' , 'userId' , { { GOOGLEANALYTICS_USER_ID } } ) ; { % endif % }
2728 { % if S_ANONYMIZE_IP % } ga ( 'set' , 'anonymizeIp' , true ) ; { % endif % }
29+ { % if S_COOKIE_SECURE % } ga ( 'set' , 'cookie_flags' , 'samesite=none;secure' ) ; { % endif % }
2830 { % EVENT phpbb_googleanalytics_alter_ga_requirements - % }
2931 ga ( 'send' , 'pageview' ) ;
3032 </ script >
Original file line number Diff line number Diff line change @@ -48,7 +48,9 @@ protected function setUp(): void
4848 // Load/Mock classes required by the event listener class
4949 $ this ->config = new \phpbb \config \config ([
5050 'googleanalytics_id ' => 'UA-000000-01 ' ,
51+ 'googleanalytics_tag ' => 1 ,
5152 'ga_anonymize_ip ' => 0 ,
53+ 'cookie_secure ' => 0 ,
5254 ]);
5355 $ this ->template = $ this ->getMockBuilder ('\phpbb\template\template ' )
5456 ->getMock ();
@@ -108,6 +110,7 @@ public function test_load_google_analytics()
108110 'GOOGLEANALYTICS_TAG ' => $ this ->config ['googleanalytics_tag ' ],
109111 'GOOGLEANALYTICS_USER_ID ' => $ this ->user ->data ['user_id ' ],
110112 'S_ANONYMIZE_IP ' => $ this ->config ['ga_anonymize_ip ' ],
113+ 'S_COOKIE_SECURE ' => $ this ->config ['cookie_secure ' ],
111114 ]);
112115
113116 $ dispatcher = new \phpbb \event \dispatcher ();
You can’t perform that action at this time.
0 commit comments