@@ -61,7 +61,7 @@ public static function getSubscribedEvents()
6161 {
6262 return [
6363 'core.page_header ' => 'load_google_analytics ' ,
64- 'core.acp_board_config_edit_add ' => 'add_googleanalytics_configs ' ,
64+ 'core.acp_board_config_edit_add ' => 'add_googleanalytics_configs ' ,
6565 'core.validate_config_variable ' => 'validate_googleanalytics_id ' ,
6666 'core.page_footer_after ' => 'append_agreement ' ,
6767 ];
@@ -77,9 +77,9 @@ public function load_google_analytics()
7777 {
7878 $ this ->template ->assign_vars ([
7979 'GOOGLEANALYTICS_ID ' => $ this ->config ['googleanalytics_id ' ],
80- 'GOOGLEANALYTICS_USER_ID ' => $ this ->user ->data ['user_id ' ],
81- 'S_ANONYMIZE_IP ' => $ this ->config ['ga_anonymize_ip ' ],
82- 'S_COOKIE_SECURE ' => $ this ->config ['cookie_secure ' ],
80+ 'GOOGLEANALYTICS_USER_ID ' => ( int ) $ this ->user ->data ['user_id ' ],
81+ 'S_ANONYMIZE_IP ' => ( bool ) $ this ->config ['ga_anonymize_ip ' ],
82+ 'S_COOKIE_SECURE ' => ( bool ) $ this ->config ['cookie_secure ' ],
8383 ]);
8484 }
8585
@@ -136,7 +136,7 @@ public function add_googleanalytics_configs($event)
136136 */
137137 public function validate_googleanalytics_id ($ event )
138138 {
139- // Check if the validate test is for google_analytics
139+ // Check if the validation test is for googleanalytics_id
140140 if ($ event ['config_definition ' ]['validate ' ] !== 'googleanalytics_id ' || empty ($ event ['cfg_array ' ]['googleanalytics_id ' ]))
141141 {
142142 return ;
0 commit comments