npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@elliemae/pui-user-monitoring

v1.25.4

Published

Browser Realtime User Monitoring & Web Analytics

Downloads

3,308

Readme

pui-user-monitoring

Build Status

Browser Real Time User monitoring (BRUM) library

This library currently uses App Dynamics BRUM solution

Prerequisites for integration

App Key - Unique key which tracks your application on AppDynamics. Keys will be different in Appdynamics Dev vs Prod environment. Please work with Naveed Mohammed [email protected] to get the keys for your application

Integration

Skip step 1 if your application is using pui-app-sdk node module. (check your applicaiton package.json)

  1. npm install -save pui-user-monitoring

  2. Add below script to head tag of your html file. This should be the first script execution in the html.

      window.emui = window.emui || {};
      window.emui.brumConfig = {
        appKey: '<key>'
      };
    </script>
    
    <script
      src="https://assets.ellieservices.com/pui-user-monitoring"
      type="module"
    ></script>```
  • change key to the appKey provided for your application
  • change version to the semantic version of the pui-user-monitoring library you installed in step 1. (if you are using pui-app-sdk, you can find the pui-user-monitoring library version inside the node_modules/@elliemae/pui-user-monitoring/package.json)

appKey, beaconUrlHttp, beaconUrlHttps values are different for AppDyanmics Development vs Production Environments. All pre-prod application deployments should report metrics to AppDynamics Development environment. Production application deployments should use AppDynamics production enviornment. Please make sure your deployment scripts are coded to update the values for appKey, beaconUrlHttp & beaconUrlHttps values during production application deployment.

Configuration (window.emui.brumConfig)

By default init() functions set some adrum settings which can be override easily.

{
  // app dynamics key
  appKey: <key>, //required
  // app dyanmics beacons listener url
  beaconUrlHttp: 'http://appdynamics-dev-eum.elliemae.com:80', //default
  // app dyanmics beacons listener url (https)
  beaconUrlHttp: 'https://appdynamics-dev-eum.elliemae.com:80', //default
  // Url where adrum.ext files are hosted
  adrumExtUrlHttp: '/public/js/vendor', //default
  // Url where adrum.ext files are hosted (https)
  adrumExtUrlHttps: '/public/js/vendor', //default
  // cross-domain session correlations
  xd: { enable: true } //default,
  // single page monitoring
  spa: { spa2: true }, //default
  // function that returns a custom user data as key value pair object
  customData: null //default
}

API

setCustomUserData() : Binds callback functions to send custom user specific data to track real time scenarios. It takes following parameters

pageViewCustomDataCB : Callback gets trigger for page

vPageViewCustomDataCB : Callback gets trigger for virtual pages

ajaxCustomDataCB : Callback gets trigger for ajax call

setXHRFilter() : It Filters XHR calls by URLs patterns. Note : To use XHR filters, you must assign XHR filters to xhr.include and xhr.exclude before you inject the adrum.js script It takes 'filterPattern' as parameter.

{
  include : {
      urls:
        [
          {
            pattern: ".*foo.*"
          },
          {
            pattern: ".*bar.*"
          }
        ],
      method: 'GET'
  },
  exclude : {
      urls:
        [
          {
            pattern: ".*user-profile.*"
          }
        ],
      method: 'POST'
  }
}

setVPageFilter() : It Excludes Virtual Pages from Being Monitored based on filter patterns. It takes 'filterPattern' as parameter.

exclude: {
  "urls": [
    {
      "pattern": "contact"
    },
    {
      "pattern": "api*"
    }]
  }
}

setCustomVPageName() : To Set Custom Virtual Page Names Note : To name virtual pages with the JavaScript Agent, you need to enable SPA2 monitoring.

setMaxResUrlSegmentNumber() : To Set the Maximum Number of Segments

setXHRPayloadParams() : To capture xhr payload parameters based on patterns It takes 'payloadParams' as parameter.

[
  {
    method: 'POST'
  },
  {
    urls: [
      {
        pattern: '.*/businessContacts'
      }
    ]
  }
]
```javascript

`setSPA2()` : It sets the spa2 settings.

_Note : By default setting is set to spa2._

`setCustomPageName()` : To Set Custom Page Names.
Takes 'userPageName' as parameter

`reportError()` : To Report Events with the JavaScript API.
It takes 'exception' object as parameter

```javascript
{
  message : 'Uncaught Exception',
  line : 10
}

disableFetchMonitoring() : To Disable Monitoring of Fetch API Calls.

reportWindowOnError() : To Handle the window.onerror Event.

Note: If any script on your monitored web pages, including library code, sets the JavaScript window.onerror event, add the following method to the page immediately after setting window.onerror

disableBrowserMonitoring() : To Disable Browser Monitoring Programmatically

enableBrowserMonitoring() : To Enable Browser Monitoring Programmatically

startVirtualPageWithCustomUrl() : Marking the beginning of the virtual page and waiting for the end to be manually marked. It takes 'myCustomVPName' as parameter

startVirtualPageNotWaitingForMarkVirtualPageEnd() : Marking the beginning of the virtual page and allowing the JS Agent to mark the end of the virtual page. It takes 'myCustomVPName' as parameter

endVirtualPage() : Manually marking the end of the virtual page.

filterURLQueryString() : To Hide All or Parts of the URL Query String. It takes 'filterURLQuery' as parameter. filterURLQuery can be false(by default), true or array of keys.

isScriptLoaded() : checks for agent script injection and returns 'window.Adrum' object for easy client side implementation.

getErrorHandle() : To get error event handle to set required error log properties.

getAjaxHandle() : To get ajax event handle to set required ajax log properties. User need to set tracking ajax url handles comes with four function which can be call in different stages of the ajax call.

url()

markSendTime(), markFirstByteTime(), markRespAvailTime(), markRespProcTime()

getVPageViewHandle() : To get virtual page view event handle to set required ajax log properties.

reportAjax() : To Report a custom Ajax event passing properties It takes 'reportInfo' as parameter.

{
  url : 'http://abc.com/api',
  markSendTime : 100,
  markFirstByteTime : 200,
  markRespAvailTime : 300,
  markRespProcTime : 400
}

setVPFilter() : Excludes Ajax from VPageView using ADRUM configuration It takes 'filterPattern' as parameter.

{
  include : {
      urls:
        [
          {
            pattern: ".*foo.*"
          },
          {
            pattern: ".*bar.*"
          }
        ],
      method: 'GET'
  },
  exclude : {
      urls:
        [
          {
            pattern: ".*user-profile.*"
          }
        ],
      method: 'POST'
  }
}

report() : To Report a custom Ajax/Error/VPageView event passing properties

captureApiPostParameters() : To Set Ajax Request Names Based on Captured POST Parameters It takes two parameters

url : url to track statistics.

getFromBodyCB : Callback function to capture post parameters.