If you need to disable the JavaScript Agent at runtime, you must stop the agent from sending data to the EUM server. The agent sends data to the EUM Server through beacons, so you must use the pauseReporting() JavaScript API to stop sending beacons.

Stop Sending Beacons

To stop the JavaScript from sending beacons, set pauseReporting() to True. The call can be added anywhere after ADRUM is loaded.

<script>
...	
	function turnOffReporting() {
            ADRUM.pauseReporting(true);
    }
...
</script>
JS

Resume Sending Beacons

To resume the JavaScript to send beacons, set pauseReporting() to false. The call can be added anywhere after ADRUM is loaded.

<script>
...	
	function turnOffReporting() {
            ADRUM.pauseReporting(false);
    }
...
</script>
JS