- Open Chrome and navigate to https://github.com/dynatrace-wwse/rum-injection-demo, click the
Code
button, thenDownload ZIP
- Open your download folder and unzip
rum-injection-demo-main.zip
-
In Chrome, select
menu "𐄛" > Extensions > Manage Extensions
-
Enable Developer Mode in the top right
-
Click
Load Unpacked
-
Nagivated to the unzipped directory from step #2 and click
Select
-
Navigate to the hub and search for "Web application monitoring via manual insertion" and click “Set up”
-
Type in the domain of the website you want to monitor and click "add web application"
-
Click
View Application
this brings you to the application screen -
Under General Settings, navigate to "enablement and cost control", toggle on "Enable New Real User Monitoring Experience" and "Enable Session Replay Classic" and click "Save Changes"
-
Navigate to
Web Application Injection Setup
settings page in Dynatrace, and copy the src value from the javaScript tag snippet -
Click the
Extension
iconin toolbar, then Click
Dynatrace RUM Injector
extension. -
Enter the domain of the site you wish to demo on, then paste your javascript src url from step #1, and hit
Save
You may encounter sites that restrict remote content loading and request using the Content Security Policy (CSP).
Content Security Policy (CSP) is a feature that helps to prevent or minimize the risk of certain types of security threats. It consists of a series of instructions from a website to a browser, which instruct the browser to place restrictions on the things that the code comprising the site is allowed to do. The primary use case for CSP is to control which resources, in particular JavaScript resources, a document is allowed to load. This is mainly used as a defense against cross-site scripting (XSS) attacks, in which an attacker is able to inject malicious code into the victim's site.
Since we are injecting our RUM locally via an extension, you may see these warnings in your DevTool Console, for example:
-
Navigate to the site you plan to demo on, and was configured in your extension settings
-
Switch to the
Sources
tab, thenOverrides
sub-tab. -
Click
Select folder for overrides
-
Navigate to
overrides
directory in you unzipped extension folder and pressSelect
-
Refresh the page and you should no any CSP warning, and the RUM extension and beacon calls should now be seen in the network tab
⚠️ Warning these overrides only function while the DevTool window is open. Be sure to leave the DevTool open for the entire time you are running your demo⚠️
Normally, RUM sessions end on of the ways documented here: https://docs.dynatrace.com/docs/shortlink/user-session#user-session-end
However, we want to be able to create a bunch of sessions quickly without having to close the browser or wait for inactivity. To do this, navigate to the console in Chrome Dev Tools and type
dtrum.endSession()
and hit enter