Index: googleanalytics.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.admin.inc,v retrieving revision 1.13.2.5 diff -u -r1.13.2.5 googleanalytics.admin.inc --- googleanalytics.admin.inc 5 Jun 2010 01:37:19 -0000 1.13.2.5 +++ googleanalytics.admin.inc 6 Jun 2010 00:26:47 -0000 @@ -171,6 +171,13 @@ '#collapsed' => TRUE, ); + $form['advanced']['googleanalytics_tracker_anonymizeip'] = array( + '#type' => 'checkbox', + '#title' => t('Anonymize visitors IP address'), + '#default_value' => variable_get('googleanalytics_tracker_anonymizeip', 0), + '#description' => t('Tell Google Analytics to anonymize the information sent by the tracker objects by removing the last octet of the IP address prior to its storage. Note that this will slightly reduce the accuracy of geographic reporting. In some countries it is not allowed to collect personally identifying information for privacy reasons and this setting may help you to comply with the local laws.'), + ); + $form['advanced']['googleanalytics_cache'] = array( '#type' => 'checkbox', '#title' => t('Locally cache tracking code file'), Index: googleanalytics.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.install,v retrieving revision 1.13.2.3 diff -u -r1.13.2.3 googleanalytics.install --- googleanalytics.install 28 May 2010 18:21:31 -0000 1.13.2.3 +++ googleanalytics.install 6 Jun 2010 00:26:47 -0000 @@ -38,6 +38,7 @@ variable_del('googleanalytics_roles'); variable_del('googleanalytics_visibility'); variable_del('googleanalytics_pages'); + variable_del('googleanalytics_tracker_anonymizeip'); variable_del('googleanalytics_translation_set'); } Index: googleanalytics.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.module,v retrieving revision 1.36.2.7 diff -u -r1.36.2.7 googleanalytics.module --- googleanalytics.module 5 Jun 2010 14:44:09 -0000 1.36.2.7 +++ googleanalytics.module 6 Jun 2010 00:26:47 -0000 @@ -140,6 +140,9 @@ // Build tracker code. $script = 'var _gaq = _gaq || [];'; $script .= '_gaq.push(["_setAccount", ' . drupal_to_js($id) . ']);'; + if (variable_get('googleanalytics_tracker_anonymizeip', 0)) { + $script .= '_gaq.push(["_anonymizeIp"]);'; + } if (!empty($segmentation)) { $script .= $segmentation; }