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 Web AppBuilder for ArcGIS 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 Global Collection Interval for all Web Applications.

Specific Web Application Alarm Settings

You can set specific alarms for each Web Application:

Add a Web AppBuilder Application

In order to add a web app created in Web AppBuilder for ArcGIS (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 Web AppBuilder for ArcGIS, 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 the Web AppBuilder for ArcGIS (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:

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

    Only the Developer Edition of Web AppBuilder for ArcGIS 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 Web AppBuilder for ArcGIS (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:

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

  15. Click Save.

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:

  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");
    }
    //...  

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:

  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:

  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:

    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.

    In the sidebar, a message indicates that Analytics is adding the new resource.

    Once the Web Application has been added, the name you entered for this Web Application is listed under Web Applications in the sidebar.

© 2019 Latitude Geographics Group Ltd. All Rights Reserved.

Documentation Version 1.5