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

How to set serverUrl? #211

Closed
BamMironov opened this issue Sep 6, 2023 · 1 comment
Closed

How to set serverUrl? #211

BamMironov opened this issue Sep 6, 2023 · 1 comment

Comments

@BamMironov
Copy link

BamMironov commented Sep 6, 2023

According to the docs there should be a way to assign a server URL. For instance, if we have users from the EU we have to set a different URL in order to be GDRP compliant.

As of now, [email protected] seems to miss this feature.
If I am not mistaken, there was a way to do that through the init method that accepted the serverUrl parameter but now there is no such method. There is the initialize method but it doesn't accept any parameters.

image

So how can I set serverURl?

@catliaw
Copy link

catliaw commented Oct 20, 2023

Hi @BamMironov, according to the documentation, you would need to init() the SDK first. Then you run mixpanel.setServerURL("https://api-eu.mixpanel.com"); to change the server URL to EU. I do not see a way where you can init the SDK with the EU server URL as a param in the init() code. Looking at the git-blame, I can see that this method for changing server URL has existed for 3 years: https://github.com/mixpanel/mixpanel-react-native/blame/f91b9a12f213c410c1e1cfec41835c70d9d605bf/ios/MixpanelReactNative.swift#L33

By chance were you using or looking at a different SDK? I know that the JS SDK accepts the EU server URL as a init() param. Different SDKs set it differently.

Also please note that a single Mixpanel project exists in only one region (US or EU). If your project is based in the US region (no eu.mixpanel.com in your logged-in project URL), you would need to create a separate project in EU region (can select this in the project creation modal). Then you would also need to update the project token to that of the EU residency project when you detect an EU user. It might make sense to make your entire Mixpanel project EU based if you want to analyze EU and non-EU users together in the same project.

@zihejia zihejia closed this as completed Mar 2, 2024
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

No branches or pull requests

3 participants