@@ -127,6 +127,24 @@ public function generate()
127127 ],
128128 ],
129129 ],
130+ [
131+ 'type ' => 'switch ' ,
132+ 'label ' => $ this ->module ->l ('Disable Back Office Tracking ' ),
133+ 'name ' => 'GA_TRACK_BACKOFFICE_DISABLED ' ,
134+ 'hint ' => $ this ->module ->l ('Use this option to disable the tracking inside the Back Office ' ),
135+ 'values ' => [
136+ [
137+ 'id ' => 'ga_track_backoffice ' ,
138+ 'value ' => 1 ,
139+ 'label ' => $ this ->module ->l ('Enabled ' ),
140+ ],
141+ [
142+ 'id ' => 'ga_do_not_track_backoffice ' ,
143+ 'value ' => 0 ,
144+ 'label ' => $ this ->module ->l ('Disabled ' ),
145+ ],
146+ ],
147+ ],
130148 ],
131149 'submit ' => [
132150 'title ' => $ this ->module ->l ('Save ' ),
@@ -158,6 +176,7 @@ public function generate()
158176 $ helper ->fields_value ['GA_USERID_ENABLED ' ] = Configuration::get ('GA_USERID_ENABLED ' );
159177 $ helper ->fields_value ['GA_CROSSDOMAIN_ENABLED ' ] = Configuration::get ('GA_CROSSDOMAIN_ENABLED ' );
160178 $ helper ->fields_value ['GA_ANONYMIZE_ENABLED ' ] = Configuration::get ('GA_ANONYMIZE_ENABLED ' );
179+ $ helper ->fields_value ['GA_TRACK_BACKOFFICE_DISABLED ' ] = Configuration::get ('GA_TRACK_BACKOFFICE_DISABLED ' );
161180
162181 return $ helper ->generateForm ($ fields_form );
163182 }
@@ -174,6 +193,7 @@ public function treat()
174193 $ gaUserIdEnabled = Tools::getValue ('GA_USERID_ENABLED ' );
175194 $ gaCrossdomainEnabled = Tools::getValue ('GA_CROSSDOMAIN_ENABLED ' );
176195 $ gaAnonymizeEnabled = Tools::getValue ('GA_ANONYMIZE_ENABLED ' );
196+ $ gaTrackBackOffice = Tools::getValue ('GA_TRACK_BACKOFFICE_DISABLED ' );
177197
178198 if (!empty ($ gaAccountId )) {
179199 Configuration::updateValue ('GA_ACCOUNT_ID ' , $ gaAccountId );
@@ -196,6 +216,11 @@ public function treat()
196216 $ treatmentResult .= $ this ->module ->displayConfirmation ($ this ->module ->l ('Settings for Anonymize IP updated successfully ' ));
197217 }
198218
219+ if (null !== $ gaTrackBackOffice ) {
220+ Configuration::updateValue ('GA_TRACK_BACKOFFICE_DISABLED ' , (bool ) $ gaTrackBackOffice );
221+ $ treatmentResult .= $ this ->module ->displayConfirmation ($ this ->module ->l ('Settings for Disable Back Office tracking updated successfully ' ));
222+ }
223+
199224 return $ treatmentResult ;
200225 }
201226}
0 commit comments