Generating the JavaScript snippet and inserting it in your application


Monitor end-user experience data by adding a JavaScript snippet to the <head> element of your web application's HTML page. The snippet enables you to monitor key metrics of your end users' digital experience with your application.

To generate the JavaScript snippet for your application

  1. From the Settings menu, select End User Experience.
  2. Click + Add Application.
  3. Enter the name of the application that you want to monitor (for example, AcmeBookStore) and click Add.
    The application name can be up to 100 characters long.
  4. The application details screen is displayed.
    Click Copy to Clipboard from the Code Snippet tab to view and copy the snippet for this application.

To insert the JavaScript in your application

  1. From the Settings menu, select End User Experience.
  2. Select an application from the list, and select the Code Snippet tab
    The snippet includes an automatically generated unique token, which is used to identify the account.

    <script type="text/javascript">
        var BMCRum = {
            startTime: new Date().getTime(),
            token: "abcd-ef-ghij-klmn",
            appName: "AcmeBookStore"
        };
    </script>
    <script type="text/javascript" src=" https://eue.truesight.bmc.com/euem-1.0.0.min.js "></script>

  3. Click Copy to Clipboard and paste the JavaScript snippet in the <head> element of your web application.

    Warning

    Do not modify details such as the token and appName in the JavaScript snippet. This can cause unexpected errors.

  4. Go to your application's HTML page, and paste the snippet in the <head> element:

    • If the <head> element contains a <meta> element, insert the snippet after the <meta> element.
    • If the <head> element contains a <script> element, insert the snippet before the first <script> element.
    • If the <head> element does not contain a <script> element, insert the snippet at the end of the <head> element, before the closing </head> tag.

    js_snippet_placement.png

  5. Save the page.
  6. Verify that the snippet appears in your application's web pages.

Where to go from here

After you add the snippet to your application, configure application source rules and configure data collection for custom fields. Thereafter, use the system default view for analyzing end-user experience with your configured applications.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*