Skip to content

Commit

Permalink
Merge pull request #26 from wurststulle/master
Browse files Browse the repository at this point in the history
add anonymize_ip configuration to module.config.php
  • Loading branch information
Jurian Sluiman committed Jul 14, 2013
2 parents 1db9e82 + 1f21937 commit 3e067a9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ public function getServiceConfig()
if (isset($config['allow_linker'])) {
$tracker->setAllowLinker($config['allow_linker']);
}

if (true === $config['anonymize_ip']) {
$tracker->setAnonymizeIp(true);
}

if (false === $config['enable']) {
$tracker->setEnableTracking(false);
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
'id' => '',
'domain_name' => '',
'allow_linker' => false,
'anonymize_ip' => false,
),
);
);

0 comments on commit 3e067a9

Please sign in to comment.