Web Application Configuration

You need to add the Web Applications that you want to monitor to Analytics as these are not added automatically.

To set up alarms when you have a Web Application that requires authentication, you need to enter a username and password that has access to the Web Application. Only Windows Authentication is supported.

Once you have added Web Applications, you can enable or disable a Web Application, or remove it completely.

You can monitor any of the following kinds of Web Applications using Analytics:

Each type of Web Application is added using a different procedure.

The procedure for custom Web Applications requires a detailed knowledge and understanding of the code of the specific Web Application. For this reason, we recommend that only the person who developed the application, or someone who knows the code well, should add a custom Web Application to Analytics.

Data Collected from Supported App Types

When configured, the following information is collected from all the ArcGIS Web AppBuilder apps and Esri Configurable app types that Analytics supports. See Supported Web Apps for more information on which app types are supported.

Default Web Application Settings

You can change the Default Collection Interval for all Web Applications.

Specific Web Application Alarm Settings

You can set specific alarms for each Web Application:

Enable or Disable Monitoring

You can enable or disable monitoring of a Web Application with the following procedure. When monitoring is disabled, Analytics will stop checking alarms for this Web Application, however, any data it sends to Analytics will continue to be saved. Previously collected information can still be viewed in Analytics when monitoring is disabled.

To enable or disable monitoring a Web Application:

  1. In Configuration, click Web Applications.

  2. Click the name of the Web Application for which you want to enable or disable monitoring.

  3. Click at the top right.

Remove a Web Application

When you remove a Web Application, it no longer appears in Analytics and its collected information is no longer accessible.

To remove a Web Application:

  1. In Configuration, click Web Applications.

  2. Click the name of the Web Application you want to remove.

  3. Click at the top right.

  4. Click OK.

Add a Web AppBuilder Application

In order to add a web app created in ArcGIS Web AppBuilder (Developer Edition) for Analytics to monitor, you need to download and unzip the Geocortex Analytics Web AppBuilder widget, add it to the web app you want to monitor, and configure the widget with the Analytics App ID and Relay URL so that the widget knows where to send the data.

Adding a Web AppBuilder application for Analytics to monitor requires an understanding of how to edit an app in ArcGIS Web AppBuilder, as well as how to edit the config.json file of the web app.

You can only add a web app to Analytics if it is developed in ArcGIS Web AppBuilder (Developer Edition) as this is located on a computer. If your web app is hosted in ArcGIS Online or a Portal for ArcGIS, Analytics cannot monitor it.

Analytics collects information about the web app when the application is being used, but not when it is being edited.

To add a Web AppBuilder application:

  1. Open the Analytics application, and then click Configuration.

  2. At the bottom of the sidebar, click Add, and then click Web Application.

  3. On the Setup tab, enter the following information:

    • Name: Type in the name of the web app as you want it to appear in the sidebar and in reports in Analytics.

    • Hostnames: Add the name of all the hosts of the Web Application. Analytics will only accept data coming from these hosts. If your application can be accessed through a reverse proxy, you must add it to this list.

      You can use a fully qualified domain name mydomain.com, or a machine name mymachinename, or the hostname of a reverse proxy www.myreverseproxy.com.

      Analytics can only monitor a web app if it is hosted on a web server on your network. If the web app is hosted on ArcGIS Online or Portal for ArcGIS, Analytics cannot access the web app in order to collect data.

  4. For the Application Type, select ArcGIS Web AppBuilder (Developer Edition).

    Only the Developer Edition of ArcGIS Web AppBuilder can be used for adding a Web AppBuilder app for Analytics to monitor. The instructions in this procedure may not mention the Developer Edition every time, but no other edition of Web AppBuilder will work.

  5. Click Download File, save the geocortex-analytics-web-appbuilder-widget.zip file to a location on the computer.

  6. Extract the contents of the zip file and copy the extracted WebAppBuilderForArcGIS folder to the widgets folder of the web app you want to monitor.

    The extracted folder contains multiple files and folders that make up the Geocortex Analytics Web AppBuilder widget.

    The default folder for your web app widgets is likely to be: 

    [web-appbuilder-directory]/server/apps/[web-appbuilder-app-id]/widgets

  7. In Windows Explorer, navigate to the folder above the widgets folder, and open the config.json file in a text editor.

  8. Scroll down to the "widgetOnScreen": { tag.

  9. From the Setup tab in Analytics, copy the URI in the code snippet and paste it into "widgets" property in the in the text editor.

  10. Open ArcGIS Web AppBuilder (Developer Edition), and then click the pencil icon to edit the web app you want to monitor.

  11. Click the Widget tab.

  12. In the list of widgets, click the pencil icon to edit the Geocortex Analytics Web AppBuilder widget.

  13. From the Setup tab in Analytics Configuration, do the following:

    • Copy the App ID and paste it into the App Id field in the Web AppBuilder widget.

    • Copy the Relay URL and paste it into the Relay URL field in the Web AppBuilder widget.

  14. In the Web AppBuilder Widget, click OK to save the changes.

  15. Click Save.

  16. To start receiving data from the configured Web AppBuilder application, browse back to Analytics Reports and click Save.

    A message indicates that the web application is being added. When the process is complete, the new web application appears in the sidebar under Web Applications and you can set more configuration options.

Add an Esri Configurable App

Adding a Web Application created using an Esri Configurable App involves adding a script tag to the index.html file of your application. You then need to identify one of three possible options in your application in order to insert the Analytics App ID and URL into the correct location. One option is a file your app may have, the other two options are possible lines of code within the index.html file of your app. Each Esri Configurable App will have only one of these options, so it is just a matter of identifying which one your application has.

To add an Esri Configurable App: 

  1. Open Geocortex Analytics, and then click Configuration.

  2. At the bottom of the sidebar, click Add, and then click Web Application.

  3. On the Setup tab, enter the following information:

    • Name: Type in the name of the Web Application as you want it to appear in the sidebar and in reports in Analytics.

    • Hostnames: Add the name of all the hosts of the Web Application. Analytics will only accept data coming from these hosts. If your application can be accessed through a reverse proxy, you must add it to this list.

      You can use a fully qualified domain name mydomain.com, or a machine name mymachinename, or the hostname of a reverse proxy www.myreverseproxy.com.

  4. For the Application Type, select Esri Configurable App.

  5. Click Download File, extract the  geocortex-analytics-api.js file and add it to the root folder of your Esri Configurable app.

  6. From the Script Tag to Include code area, copy <script type="text/javascript" src="geocortex-analytics-api.js"></script> , and then paste it into the <head> tag of your Index.html.

    This line of code loads the extracted geocortex-analytics-api.js file into the application.

  7. In the file structure of your application, within the app folder, look for a main-app.js file. If you find the file, open it in a text editor. Search for the Core.init (new MainView()); line of code and add the gcxanalytics.configConfigurableApp snippet below that line, for example:

    else {
           Core.init(new MainView());
           gcxAnalytics.configConfigurableApp(app, "20a5a3f8-477d-4af8-a35b-8adf82dc91a5", "http://[machineName]/Geocortex/Analytics/WebApplication/Relay");
    }
  8. If you do not find the main-app.js file, open the Index.html in a text editor and search for the text "myApp.startup". If you find this text, paste the gcxanalytics.configConfigurableApp code snippet below the myApp.startup(config); line of code, for example:

    // ...
          myApp.startup(config);
          gcxAnalytics.configConfigurableApp(myApp, "20a5a3f8-477d-4af8-a35b-8adf82dc91a5", "http://[machineName]/Geocortex/Analytics/WebApplication/Relay");
    }
    //...  
  9. If you do not find the myApp.startup text in the Index.html file, search for the text "boilerplate". If you find the line app.init(boilerplate);, then add the gcxanalytics.configConfigurableApp code snippet below this line in the code, for example:

    // ...
          app.init(boilerplate);
          gcxAnalytics.configConfigurableApp(App, "20a5a3f8-477d-4af8-a35b-8adf82dc91a5", "http://[machineName]/Geocortex/Analytics/WebApplication/Relay");
    }
    //...  
  10. To start receiving data from the Esri Configurable App, browse back to Analytics Reports and click Save.

    A message indicates that the web application is being added. When the process is complete, the web application name appears in the sidebar under Web Applications and you can set more configuration options.

Add a Custom Web Application

Adding a Web Application requires an in-depth understanding of the code of the Web Application. The procedure involves adding code snippets into specific places in the code in order to collect different kinds of information.

It is important that the steps in the following procedure be done in the order they appear.

To add a custom Web Application:

  1. Open the Reports application, and then click Configuration.

  2. At the bottom of the sidebar, click Add, and then click Web Application.

  3. On the Setup tab, enter the following information:

    • Name: Type in the name of the Web Application as you want it to appear in the sidebar and in reports in ProductName.

    • Hostnames: Add the name of all the hosts of the Web Application. ProductName will only accept data coming from these hosts. If your application can be accessed through a reverse proxy, you must add it to this list.

      You can use a fully qualified domain name mydomain.com, or a machine name mymachinename, or the hostname of a reverse proxy www.myreverseproxy.com.

  4. For the Application Type, select Custom Web Application.

  5. Click Download File, extract the geocortex-analytics-api.js file and add it to the root folder of the application.

  6. From the Script Tag to Include code area, copy <script type="text/javascript" src="geocortex-analytics-api.js"></script> , and then paste it into the <head> tag of your root application file, for example, Index.html.

    This line of code loads the extracted geocortex-analytics-api.js file into the application.

  7. If your Web Application is not secured, copy and paste the following into the <head> tag of your root application file.

    <script type="text/javascript">

    gcxAnalytics.config("7f6db567-d6bf-474f-9251-2d87cc56e91c", "http://[domainName]/Geocortex/Analytics/WebApplication/Relay")

    </script>

    This code supplies the following:

    • The Analytics app ID, for example, "7f6db567-d6bf-474f-9251-2d87cc56e91c" so that the code can send data to the Analytics Hub server.

    • The URL to the ProductName Hub Server, for example, "http://[domainname]/Geocortex/Analytics/WebApplication/Relay" so that the code knows where to send the collected information.

      If your Web Application is visible to users outside of your network, the URL that you use in this script must also be accessible from outside the network.

  8. If your Web Application is secured, copy and paste the following into your Web Application after login occurs in your Web Application code.

    gcxAnalytics.config("7f6db567-d6bf-474f-9251-2d87cc56e91c", "http://[domainName]/Geocortex/Analytics/WebApplication/Relay")
  9. If you want to monitor map information from your Web Application, copy one of the following functions:

    • gcxAnalytics.configMap(map);

    • gcxAnalytics.configMap(map, mapView);

    • gcxAnalytics.configMap(mapView);

    Paste the function into your Web Application code after you initialize the map in the Web Application, and then pass your map object into the configMap function.

    The variable "map" can be either an esri.Map (v3.x and v4.x) or an esri.WebScene (v4.x).

    The variable "mapView" can be either an esri.views.MapView (v4.x) or an esri.views.SceneView (v4.x).

  10. If you want to monitor login information for Portal or ArcGIS Online using the Esri Javascript API, uncomment the following:

    gcxAnalytics.configPortal(portal);

    Paste the function into your Web Application code after you initiate the portal in the Web Application, and then pass your portal object into the configPortal function.

    The variable "portal" can be either an esri.arcgis.Portal (v3.x ) or an esri.portal.Portal (v4.x).

  11. Click Save.

    A message indicates that the web application is being added. When the process is complete, the web application name appears in the sidebar under Web Applications and you can set more configuration options.