[COMPASS-2268] Block embargoed countries automatically from Compass Intercom Created: 03/Nov/17  Updated: 27/Oct/23  Resolved: 08/Oct/19

Status: Closed
Project: Compass
Component/s: Intercom
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Brian Blevins Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: COMPASS-2239
Documentation Changes Summary:

Intercom in Compass is being retired.


 Description   

Use geolocation to automatically disable the Intercom Messenger widget when the user's IP address indicates they are located in a restricted or embargoed country. Based on the Intercom documentation and feedback from one of their employees, it is not possible to impose this restriction on "users" via the Intercom.io website. It must be imposed in the application.

In Compass

It appears that Compass already has a mechanism for selectively displaying the Messenger widget. This needs to be updated to take the geolocation of the user's IP address into account.

src/internal-plugins/metrics/lib/setup.js

if (process.env.HADRON_PRODUCT !== 'mongodb-compass-community') {
    metrics.configure({
      intercom: {
        appId: INTERCOM_KEY,
        enabled: app.preferences.trackUsageStatistics,
        panelEnabled: app.preferences.enableFeedbackPanel
      }
    });
  }

Suggestion from Intercom.io

To hide the messenger for certain countries, there isn't a setting within Intercom, but you can achieve this using Javascript. You would first need to detect the country (example: http://jsfiddle.net/zK5FN/2/), and then adjust the snippet (something like the below, which would hide it for France):

var country = "";
$.get("http://ipinfo.io", function (response) {
  country = response.country;
}, "jsonp");
if (country === "FR") {
  window.intercomSettings.hide_default_launcher = true;
}

References

TECHOPS-5231
Show when a remote user is coming from an embargoed country

TECHOPS-2750
Embargoed countries restrictions
Current list of "comprehensive embargo" countries are: Cuba, Iran, Sudan, North Korea, and Syria, though this needs to be confirmed.


Generated at Wed Feb 07 22:29:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.