Skip to content

Commit

Permalink
Drupal Issue #1797988: Fixes: Universal opt-out setting opts out ever…
Browse files Browse the repository at this point in the history
…yone using Google Chrome.
  • Loading branch information
Jen Lampton committed Apr 13, 2018
1 parent 21065e0 commit 1d89616
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/googleanalytics.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"trackadsense": false,
"trackdoubleclick": false,
"tracker_anonymizeip": true,
"privacy_donottrack": true,
"privacy_donottrack": false,
"custom_dimension": [],
"custom_metric": [],
"cache": false,
Expand Down
3 changes: 2 additions & 1 deletion googleanalytics.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ function googleanalytics_admin_settings_form($form_state) {
$form['tracking']['privacy']['googleanalytics_privacy_donottrack'] = array(
'#type' => 'checkbox',
'#title' => t('Universal web tracking opt-out'),
'#description' => t('If enabled and your server receives the <a href="@donottrack">Do-Not-Track</a> header from the client browser, the Google Analytics module will not embed any tracking code into your site. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision. This feature is currently limited to logged in users and disabled page caching.', array('@donottrack' => 'http://donottrack.us/')),
'#description' => t('WARNING: Enabling this option will prevent the tracking code from appearing in Goole Chome.<br><br>
If enabled and your server receives the <a href="@donottrack">Do-Not-Track</a> header from the client browser, the Google Analytics module will not embed any tracking code into your site. Compliance with Do Not Track could be purely voluntary, enforced by industry self-regulation, or mandated by state or federal law. Please accept your visitors privacy. If they have opt-out from tracking and advertising, you should accept their personal decision. This feature is currently limited to logged in users and disabled page caching.', array('@donottrack' => 'http://donottrack.us/')),
'#default_value' => $config->get('privacy_donottrack'),
);

Expand Down
7 changes: 7 additions & 0 deletions googleanalytics.install
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,10 @@ function googleanalytics_update_1001() {
update_variable_del('googleanalytics_codesnippet_after');
update_variable_del('googleanalytics_debug');
}

/**
* Disable the problematic 'Universal web tracking opt-out' setting.
*/
function googleanalytics_update_1002() {
config_set('googleanalytics.settings', 'privacy_donottrack', FALSE);
}

0 comments on commit 1d89616

Please sign in to comment.