Injection via Nginx

If your application is served via Nginx, the 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 you are not using Nginx, an example of how to set it up as a reverse proxy can be found here.

In order to inject the Plumbr Browser Agent, 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;