Skip to content

Issue with IP Anonymization #86

@jayant-lumino

Description

@jayant-lumino

My goal is to anonymize IP addresses to comply with GDPR regulations, but I'm having trouble getting it to work correctly.

Here’s the relevant code snippet I'm using:

const googleAnalticsKey = 'G-**********';

ReactGA.initialize(googleAnalticsKey, {
  gaOptions: {
    anonymizeIp: true
  }
});

Even with anonymizeIp set to true, when I inspect the network requests using Chrome Developer Tools, I'm not seeing the aip=1 parameter in the query string, which indicates that IP anonymization isn't being applied.

I’ve also tried using ReactGA.set({ anonymizeIp: true }); after initialization, but the issue persists.

Could you please advise on how to properly enable IP anonymization using ReactGA? Is there something I’m missing, or is there another approach I should consider?

Thanks in advance for your help!

And yes according to this answer it should be enable by default but still it's not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions