Error logged in browser after using Browser Agent snippet in website.

Document ID : KB000010755
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

  When using the Browser Agent javascript snippet in webpages, you may run into issues with javascript errors seen at the browser.  This can be seen with the development tools of the browser.   The common error seen is Uncaught TypeError: Cannot read property '----------' of undefined.   In this example -------- represents a property name that can be any properly on the page.  

  This behavior is common and can be caused simply by the timing of the loading and executing of scripts on the page.  Often another page can be loaded during the execution of the Browser Agent script causing it to fail and generate the error previously described.

 

 

 

 

Environment:
All current supported APM releases.
Instructions:

To correct this behavior, it is recommended to place the Browser Agent snippet directly after the <HEAD> tag of a webpage.   Usually a trial and error session of placement of Browser Agent snippet may be needed especially in complex environments. 

Also the order of the snippets can make a difference.  The Browser Agent snippet and the Browser Agent extension snippet can be changed to be called in a different order.