PDFs

On this page:

Related pages:

Your Rating:
Results:
PatheticBadOKGoodOutstanding!
46 rates

You can add user information that is specific to your application to a browser snapshot. The information is expressed as key-value pairs, and the maximum size of all user data in a page is 2048 characters (CORS beacon) or 100 bytes (image beacon). The maximum size includes the keys-value pairs, syntax characters such as braces, and quotation marks. The information appears in the User Data section of the snapshot and is available for page snapshots, Ajax requests, and virtual pages.

Add User Data

User data is added when certain events are triggered. You can choose to set user data for each or all of the following available events:

  • PageView - this event is triggered when the base page is loaded in the browser.
  • Ajax - this event is triggered when an Ajax call is made.
  • VPageView - this event is triggered when the virtual page is created. The virtual page is a dynamically recreated version of the base page.

The events are callbacks that are part of the userEventInfo object that is assigned to window['adrum-config'] as shown below. Here just the event callback PageView is passed. Also, note that you must set window['adrum-config'] before you inject the adrum.js script.

<head>
    <script type="text/javascript">
        (function(config){
            (function(info) {
                (function(page) {
                    page.userPageName = "Shopping Cart";
                    page.userData = {
                        "username": "john_thompson",
                        "email": "jthompson@gmail.com"
                    };
                    page.userDataDouble = {
                        "total_price": 123.14
                    };
                    page.userDataDouble = {
                        "monthlyVisitFrequency": 0.13333333
                    };
                    page.userDataBoolean = {
                        "returnCustomer": true
                    };
                    page.userDataDate = {
                        "checkoutTime": ((new Date()).getTime())
                    }
                })(info.PageView || (info.PageView = {}));
                ...
            })(config.userEventInfo || (config.userEventInfo = {}))
        })(window['adrum-config'] || (window['adrum-config'] = {}));
        if ('https:' === document.location.protocol) {
            document.write(unescape('%3Cscript') 
            + " src='https://cdn.appdynamics.com/adrum/adrum-latest.js' "
            + " type='text/javascript' charset='UTF-8'"
            + unescape('%3E%3C/script%3E'));
        } else {
            document.write(unescape('%3Cscript')
            + " src='http://cdn.appdynamics.com/adrum/adrum-latest.js' "
            + " type='text/javascript' charset='UTF-8'"
            + unescape('%3E%3C/script%3E'));
        }
    </script>
    ...
</head>

For each event callback that is triggered, you can add user data by returning the following objects containing key-value pairs of different data types:

  • userData
  • userDataLong
  • userDataBoolean
  • userDataDate

So, using the same snippet with the PageView event, let's add some user data using the objects above. Note that only the context object for Ajax events has the properties method and url

<head>
    <script type="text/javascript">
        (function(config){
            (function(info) {
                (function(page) {
                    page.userPageName = "Shopping Cart";
                    page.userData = {
                        "username": "john_thompson",
                        "email": "jthompson@gmail.com"
                    };
                    page.userDataDouble = {
                        "total_price": 123.14
                    };
                    page.userDataDouble = {
                        "monthlyVisitFrequency": 0.13333333
                    };
                    page.userDataBoolean = {
                        "returnCustomer": true
                    };
                    page.userDataDate = {
                        "checkoutTime": ((new Date()).getTime())
                    }
                })(info.PageView || (info.PageView = {}));
                (function(ajax) {
                    ajax.userPageName = "Shopping Cart";
                    ajax.userData = {
                        "username": "john_thompson",
                        "email": "jthompson@gmail.com"
                    };
                    ajax.userDataDouble = {
                        "total_price": 123.14
                    };
                    ajax.userDataDouble = {
                        "monthlyVisitFrequency": 0.13333333
                    };
                    ajax.userDataBoolean = {
                        "returnCustomer": true
                    };
                    ajax.userDataDate = {
                        "checkoutTime": ((new Date()).getTime())
                    }
                })(info.Ajax || (info.Ajax = {}));
               (function(vpageview) {
        	        vpageview.userPageName = "Shopping Cart";
        	        vpageview.userData = {
                        "username": "john_thompson",
                        "email": "jthompson@gmail.com"
                    };
        	        vpageview.userDataDouble = {
                        "total_price": 123.14
                    };
        	        vpageview.userDataDouble = {
                        "monthlyVisitFrequency": 0.13333333
                    };
        	        vpageview.userDataBoolean = {
                        "returnCustomer": true
                    };
        	        vpageview.userDataDate = {
                       "checkoutTime": ((new Date()).getTime())
                    }
                })(info.VPageView || (info.VPageView = {}));
            })(config.userEventInfo || (config.userEventInfo = {}))
        })(window['adrum-config'] || (window['adrum-config'] = {}));
    </script>
    ...
</head>

The results from the code snippet above should then appear in the browser snapshot in the User Data panel.

  • username: john_thompson
  • email: jthompson@gmail.com
  • total_price: 123.14
  • monthlyVisitFrequency: 0.133333
  • returnCustomer: true
  • checkoutTime: 1464390383475

Filter by User Data

You can filter browser snapshots based on user data in the Advanced section of the browser snapshot filter: