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.
What does this PR do?
Adds ability for customer to choose which region the PX subscription is hosted in.
Are there breaking changes in this PR?
No, it is backward compatible. If data center is not specified, the historical behavior continues, the data center defaults to “united_states”.
Testing
Testing completed successfully using
Updated unit tests to test new dataCenter option
Tested against production PX environment using the "Analytics.js-Integrations Tester" tool. Verified three scenarios work as expected:
Any background context you want to provide?
We are in the process of enabling an EU datacenter that will be used by customers who wish to have all of their data hosted in the EU. We want to have the Segment code load a script from our EU datacenter instead of the current one from the US if specified by the customer.
Is there parity with the server-side/android/iOS integration components (if applicable)?
We need to make a very similar change to the “Gainsight PX Cloud Server” integration. The endpoint address needs to change based on the customer’s region selection (esp-eu.aptrinsic.com instead of esp.aptrinsic.com). Note: The Cloud Server change is independent of the JS integration change.
Does this require a new integration setting? If so, please explain how the new setting works
Yes, we need a new “dataCenter” option. It should be a dropdown/select with the following labels/values:
The default option value for new integrations should be united_states, we do not need to force the user to make a selection.
Help Text below selector:
For PX instances based in the European Union at https://app-eu.aptrinsic.com, select the EU option. For all others (at https://app.aptrinsic.com), select the United States option.
Links to helpful docs and other external resources
![image](https://user-images.githubusercontent.com/852529/108910950-7370ec00-75db-11eb-8983-ae923cc6007f.png)
Mockup of config screen showing new region setting:
**Why is this PR raised?
We are hoping to allow our mutual customers to have the option to use the new EU datacenter.
**Are there any docs surrounding the change?
Once the change is live, we will upgrade the relevant screenshots and text on this page: https://support.gainsight.com/PX/Install_PX/02_Install_Gainsight_PX_using_Segment_for_web_apps
**What will the customer impact be as a result of the change?
Customers will be able to use Segment to load the PX tag from the EU data center and comply with their GDPR requirements.
**What will the customer impact be if the change is not implemented?
EU customers will need to load the PX tag manually (not use Segment)