From 598818e643398dfcf43f83406708f8c51f2d565c Mon Sep 17 00:00:00 2001 From: wurststulle Date: Sat, 6 Jul 2013 10:52:20 +0200 Subject: [PATCH 1/5] add anonymize_ip to ServiceConfig --- Module.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Module.php b/Module.php index d697933..040d6f7 100644 --- a/Module.php +++ b/Module.php @@ -107,6 +107,10 @@ public function getServiceConfig() if (isset($config['allow_linker'])) { $tracker->setAllowLinker($config['allow_linker']); } + + if (true === $config['anonymize_ip']) { + $tracker->setAnonymizeIp($config['anonymize_ip']); + } if (false === $config['enable']) { $tracker->setEnableTracking(false); From 7ef9afd086ab9c7d476711b452e755df3c1f6ff7 Mon Sep 17 00:00:00 2001 From: wurststulle Date: Sat, 6 Jul 2013 10:53:02 +0200 Subject: [PATCH 2/5] add anonymize_ip to module.config.php --- config/module.config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/module.config.php b/config/module.config.php index 0e81bd8..5b8c67b 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -44,5 +44,6 @@ 'id' => '', 'domain_name' => '', 'allow_linker' => false, + 'anonymize_ip' => true, ), -); \ No newline at end of file +); From 223109b7c49977d4d0632e610076b417bd48cea6 Mon Sep 17 00:00:00 2001 From: wurststulle Date: Sat, 6 Jul 2013 14:46:14 +0200 Subject: [PATCH 3/5] Update module.config.php --- config/module.config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/module.config.php b/config/module.config.php index 5b8c67b..80b58cf 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -44,6 +44,6 @@ 'id' => '', 'domain_name' => '', 'allow_linker' => false, - 'anonymize_ip' => true, + 'anonymize_ip' => false, ), ); From 78036be9c0de0e09f4ee529e298d47708a9d34ed Mon Sep 17 00:00:00 2001 From: wurststulle Date: Sat, 6 Jul 2013 14:51:30 +0200 Subject: [PATCH 4/5] Update Module.php --- Module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Module.php b/Module.php index 040d6f7..2da1c4a 100644 --- a/Module.php +++ b/Module.php @@ -109,7 +109,7 @@ public function getServiceConfig() } if (true === $config['anonymize_ip']) { - $tracker->setAnonymizeIp($config['anonymize_ip']); + $tracker->setAnonymizeIp(true); } if (false === $config['enable']) { From 1f219375a397192d73777289f9d8e38f1c881945 Mon Sep 17 00:00:00 2001 From: wurststulle Date: Sun, 14 Jul 2013 11:00:48 +0200 Subject: [PATCH 5/5] Update README.md --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b23aabd..aaaae2f 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,13 @@ To collect data anonymously, set the flag in the tracker: ```php $ga->setAnonymizeIp(true); ``` - +Or, alternatively, you can set this flag inside the configuration: +```php +'google_analytics' => array( + 'anonymize_ip' => true, +), +``` +More information about what to set in which scenario is available on the [Google Help](https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApi_gat#_gat._anonymizeIp) page. ### Tracking multiple domains Google Analytics offers to track statistics from multiple domain names. In order to do so, you can set the canonical domain name and optionally allow