add anonymize ip option for google analytics#8417
Merged
mmansoor-magento merged 3 commits intomagento:developfrom Feb 18, 2017
Merged
add anonymize ip option for google analytics#8417mmansoor-magento merged 3 commits intomagento:developfrom
mmansoor-magento merged 3 commits intomagento:developfrom
Conversation
Contributor
…hp->getOrdersTrackingCode
Contributor
|
@thomas-villagers Thank you for contribution. |
Contributor
Author
|
@vrann Yes, of course! Where would that be done? I could'nt find it in Ga.php. |
vrann
reviewed
Feb 10, 2017
|
|
||
| return "\nga('create', '" . $this->escapeHtmlAttr($accountId, false) | ||
| . ", 'auto');\nga('send', 'pageview'{$optPageURL});\n"; | ||
| . ", 'auto');\nga('send', 'pageview'{$optPageURL}{$anonymizeIp});\n"; |
Contributor
There was a problem hiding this comment.
Should you set it globally instead, here?
ga('set', 'anonymizeIp', true);
Contributor
|
@thomas-villagers I've added the comment to the code, if you change it to set anonymization globally, it will be applied to other types of hits as well. |
Contributor
|
@thomas-villagers looks perfect |
mmansoor-magento
pushed a commit
that referenced
this pull request
Feb 18, 2017
mmansoor-magento
pushed a commit
that referenced
this pull request
Feb 18, 2017
|
@vrann @thomas-villagers This code is broken, the negative case was never tested. The code is doing a string comparison of |
magento-devops-reposync-svc
pushed a commit
that referenced
this pull request
Jul 28, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Hi,
I implemented an option for anonymized ips with google analytics.
The section "Google Analytics" in the backend (Stores > Configuration, Sales > Google API) has a new field "Anonymize IP".
According to the value in Anonymize IP, the ga('send' ...)-call in the generated html is either
ga('send', 'pageview', {'anonymizeIp' : false});
or
ga('send', 'pageview', {'anonymizeIp' : true});
(see https://developers.google.com/analytics/devguides/collection/analyticsjs/ip-anonymization)
this is my first try to extend magento and i'm open to suggestions.