Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add user ip to growthbook options #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amam-deriv
Copy link
Contributor

@amam-deriv amam-deriv commented Sep 9, 2024

Motivation
user ip is a needed ip address attribute to filter office ips and also blacklist/whitelist ip

Changes

  • add user_ip to attributes and core_data
  • Cookies.getJSON to not use any so it reference to the right import

src/analytics.ts Outdated
}
growthbookOptions ??= {}
growthbookOptions.attributes ??= {}
growthbookOptions.attributes.id ??= _rudderstack.getAnonymousId()
growthbookOptions.attributes.country ??=
Cookies.get('clients_country') ||
(Cookies as any).getJSON('website_status')?.clients_country ||
Cookies.getJSON('website_status')?.clients_country ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property 'getJSON' does not exist on type 'CookiesStatic & { noConflict?(): CookiesStatic; }'.

We'll need as any ?

@@ -57,6 +57,7 @@ export function createAnalyticsInstance(options?: Options) {
device_type: growthbookOptions?.attributes.device_type,
}),
...(growthbookOptions?.attributes?.url && { url: growthbookOptions?.attributes.url }),
...(growthbookOptions?.attributes?.user_ip && { url: growthbookOptions?.attributes.user_ip }),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be fall under privacy policy

As such, organizations processing IP addresses must adhere to the strict regulations on data protection and privacy. Under the GDPR, when an IP address is collected and processed, it is treated with the same level of protection as any other personal data, such as names, addresses, or social security numbers.

Need to confirm with the compliance before we proceed with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloudflare by default also collect user ip address

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants