Page tree

Skip to end of metadata
Go to start of metadata

As an application specialist, you can set up active monitoring of end-user data from any kind of HTML pages by manually inserting a JavaScript stub in your applications. You might want to use this option for one of the following reasons:

  • You want to collect end-user data from an application that is manually created in the TrueSight console.
  • You want to collect data from application pages with any web technology, including technologies that App Visibility agents do not support, such as static pages, PHP, or Node.js. See App Visibility requirements for JavaScript injection for support information.
  • You do not want to use the automatic JavaScript injection feature. For information, see Disabling end-user monitoring in App Visibility.

When you manually set up active end-user monitoring, you can collect data such as the number of users, end-to-end transaction time, and errors. For more information about collected end-user data, see Analyzing user transaction details.

Note

Applications with manually inserted JavaScript do not calculate network time separately from server time. The server time shows the combined server and network times.

The topic presents the following:

Before you begin

All components of the App Visibility server—the portal, collector, and proxy—must be installed .

Consult with your system administrator to obtain the following information:

  • Host name or IP address of the App Visibility proxy. You need the host name or IP address of the computer where the App Visibility proxy is installed.
    If the App Visibility proxy is behind a load balancing server and not receiving connections directly from end user browsers, ensure that you have the value of the App Visibility proxy callback address property. To view the callback address, see Changing App Visibility proxy settings.
  • Listening ports of the App Visibility proxy. You need the HTTP and HTTPS beacon receiver port numbers. 

To open and prepare the JavaScript from the TrueSight console

Use this method if your application is already in the TrueSight console as a manual application. If your application is not yet in the console, see To open and prepare the JavaScript from the App Visibility proxy.

  1. Open the JavaScript stub file:
    • From the TrueSight console, perform the following steps:
      1. Select Configuration > Applications.
      2. Click the name of the application to which you want to add the JavaScript.
      3. Click the action menu (vertical three dots) next to the application name, and then select Download End-User Monitoring Script.  A JavaScript file is downloaded.
  2. Open the file in a text editor.

    The file contains the following script:

    JavaScript stub for manually monitoring end users

    <script type="text/javascript">
        var BMCRum = {
            startTime: new Date().getTime(),
            appId: "appId",      
            pxyInf: {
                "httpPort": "apm_proxy_http_port",
                "host": "apm_proxy_host",
                "httpsPort": "apm_proxy_https_port",
                "beaconsRes": "/apm-proxy/rest/beacons",
                "ajaxBeaconsRes": "/apm-proxy/rest/beacons/ajax"
            },
            isManual: true
        };
    </script>
    <script type="text/javascript" src="https://apm_proxy_host:apm_proxy_https_port/static-resources/aeuem-10.1.0.min.js"></script>


    The appId value is unique to the specific application.
    The following values are automatically replaced with values from the App Visibility proxy. You can change the values if you want to connect to a different proxy.

    • apm_proxy_http_port is the port number of the HTTP beacon receiver (default value is 880).
    • apm_proxy_host is the host name or IP address of the App Visibility proxy.
    • apm_proxy_https_port is the port number of the HTTPS beacon receiver (default value is 8444).
    If you replace the values, ensure that you replace them in the last line of the script, as part of the source (src) value, using either the apm_proxy_https_port or the apm_proxy_http_port, depending on your system.

To add the JavaScript stub to your application, see To manually insert the JavaScript, below.

To open and prepare the JavaScript from the App Visibility proxy

Use this method if your application is not yet in the TrueSight console.

Note

If your application is already in the TrueSight console, do not use this method to add end-user monitoring. Instead, see To open and prepare the JavaScript from the TrueSight console.

Otherwise, you see two applications in the console that have the same name.

  1. Open the JavaScript stub file in one of the following ways:
    • In a browser window, navigate to http://apm_proxy_host:apm_proxy_port/static-resources/aeuem-stub.txt.
      Replace the following placeholders:
      • apm_proxy_host is the host name or IP address of the App Visibility proxy.
      • apm_proxy_port is the port number of the HTTP or HTTPS (depending on your system) beacon receiver.
        The default values are 880 for HTTP, or 8444 for HTTPS.
    • Open the file from the App Visibility proxy computer at  proxyInstallationDirectory \apm-proxy\webapps\static-resources\aeuem-stub.txt.

    A file with the following script opens:

    JavaScript stub for manually monitoring end users

    <script type="text/javascript">
        var BMCRum = {
            startTime: new Date().getTime(),
            //appName: "application_name",
            //epName: "entrypoint_name",
            pxyInf: {
                "httpPort": "apm_proxy_http_port",
                "host": "apm_proxy_host",
                "httpsPort": "apm_proxy_https_port",
                "beaconsRes": "/apm-proxy/rest/beacons",
                "ajaxBeaconsRes": "/apm-proxy/rest/beacons/ajax"
            },
            isManual: true
        };
    </script>
    <script type="text/javascript" src="https://apm_proxy_host:apm_proxy_https_port/static-resources/aeuem-10.1.0.min.js"></script>

  2. Copy the contents of the file to a text editor.
  3. (Optional) Replace the  application_name placeholder with a meaningful, unique application name, and remove the comment indicators (//).
    If you do not provide a value for application_name in the stub, a value is assigned through application discovery rules.
  4. (Optional) Replace the entrypoint_name placeholder with a meaningful entry point name, and remove the comment indicators (//).
    The entry point cannot contain a percent sign (%).
    If you do not provide a value for entrypoint_name in the stub, the user transaction name is automatically assigned.
  5. Replace the following values with values from the App Visibility proxy:
    • apm_proxy_http_port is the port number of the HTTP beacon receiver (default value is 880).
    • apm_proxy_host is the host name or IP address of the App Visibility proxy.
    • apm_proxy_https_port  is the port number of the HTTPS beacon receiver (default value is 8444).
  6. In the last line of the script, as part of the source (src) value, replace the value of  apm_proxy_host with value from the App Visibility proxy, and the value of either the apm_proxy_https_port or the apm_proxy_http_port , depending on your system.

To add the JavaScript stub to your application, see To manually insert the JavaScript, below.

To manually insert the JavaScript

  1. In your application's HTML page, copy the content of the stub script and paste it in the <head> element:
    • If the <head> element contains a <script> element, insert the stub before the first <script> element.
    • If the <head> element does not contain a <script> element, insert the stub at the end of the <head> element, before the closing </head> tag.
  2. Save the page.

    Ensure that the script appears in you application's web pages.

Where to go from here

After you complete the manual set up for end-user monitoring, perform the following configuration tasks:

(Infrastructure Management) You can edit an application model for an application with a manually inserted JavaScript stub. Edit the application in the same way you would other manually created application models.

After configuration is complete, you can analyze end-user experience with the User tier.

Related topics

Setting up applications for monitoring

Application models