Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-2268

Block embargoed countries automatically from Compass Intercom

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Intercom
    • Labels:
      None
    • Hide

      Intercom in Compass is being retired.

      Show
      Intercom in Compass is being retired.

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            brian.blevins@mongodb.com Brian Blevins
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: