Injection via Nginx

If using Nginx, Plumbr Browser Agent can be injected to response HTML automatically. This works using the ngx_http_sub_module module, which is normally included by default in Nginx. If not already using Nginx, an example of how to set it up as a reverse proxy can be found here.

Add the following lines to the applicable location block (the same one which is used to serve the HTML responses) and fill in the account ID and application name variable values:

set $plumbr_account_id 'your_account_id';
set $plumbr_app_name 'your_app_name';
sub_filter '<head>' '<head><script src="https://browser.plumbr.io/pa.js" crossorigin="anonymous"  data-plumbr=\'{"accountId":"$plumbr_account_id","appName":"$plumbr_app_name","serverUrl":"https://bdr.plumbr.io"}\'></script>';
sub_filter_once on;