WebAgent Installation

This document provides instructions for applying IMQA WebAgent in different browser environments.

You can install IMQA WebAgent in two ways: you can connect to the CDN server, or if you use the install wizard or do not have access to CDN, you can download the corresponding script. Right-click the link below and select “Save As”: https://imqawebviewagent.blob.core.windows.net/agent/web-agent.js

1. WPM Alone (WebAgent Installation)

This is how to install the Agent for web performance analytics in a web browser application configuration using only the WPM service.

Fetching from a CDN server

IMQA WebAgent requires inserting the script into the top of your html in the <head>.

html <head> to connect to web-agent.js
// IMQA web-agent.js connection
<script src="https://cdn.imqa.io/agent/web-agent-1.1.11.js"></script>

// IMQA web-agent Required script values
<script>
((w, c, _wv, _w, _wk, _mh, _b) => {
    w[c] = w[c] || {};
    function imqaConf(key, value){w[c][key]=value};

    imqaConf("imqaAgentUse", true);
    imqaConf("projectKey", "User project key");

    w[_w](w);
})(window, 'imqaClientConfig', 'IMQAWebviewMain', 'IMQAWebMain', 'webkit', 'messageHandlers', 'ImqaBridge')
</script>

Install locally

html <head> to connect to web-agent.js
// Connect IMQA web-agent.js 
<script src="user path/web-agent-1.1.11.js"></script>

// IMQA web-agent Required script values
<script>
((w, c, _wv, _w, _wk, _mh, _b) => {
    w[c] = w[c] || {};
    function imqaConf(key, value){w[c][key]=value};

    imqaConf("imqaAgentUse", true);
    imqaConf("projectKey", "User project key");

    w[_w](w);
})(window, 'imqaClientConfig', 'IMQAWebviewMain', 'IMQAWebMain', 'webkit', 'messageHandlers', 'ImqaBridge')
</script>

2. Both WPM/MPM (WebAgent + WebViewAgent Installation)

This is how to install the Agent for WebView/web performance analytics in mobile and web browser application configurations using both WPM and MPM services.

Fetching from a CDN server

IMQA WebAgent requires inserting the script into the top of your html in the <head>.

html <head> to connect to web-agent.js
// Connect IMQA web-agent.js
<script src="https://cdn.imqa.io/agent/web-agent-1.1.11.js"></script>
<script src="https://cdn.imqa.io/agent/webview-agent-1.1.3.js"></script>

// IMQA web-agent Required script values
<script>
((w, c, _wv, _w, _wk, _mh, _b) => {
    w[c] = w[c] || {};
    function imqaConf(key, value){w[c][key]=value};

    imqaConf("imqaAgentUse", true);
    imqaConf("projectKey", "User project key");
    if ((w[_wk] !== undefined && w[_wk][_mh] !== undefined) || w[_b] !== undefined)
      w[_wv](w);
    else w[_w](w);
})(window, 'imqaClientConfig', 'IMQAWebviewMain', 'IMQAWebMain', 'webkit', 'messageHandlers', 'ImqaBridge')
</script>

Install locally

If you use install wizard or you do not have access to CDN, you can download the corresponding script. Right-click this link below and select “Save As”:

html <head> to connect to web-agent.js
// Connect IMQA web-agent.js received locally
<script src="user path/web-agent-1.1.11.js"></script>
<script src="user path/webview-agent-1.1.3.js"></script>

// IMQA web-agent Required script values
<script>
((w, c, _wv, _w, _wk, _mh, _b) => {
    w[c] = w[c] || {};
    function imqaConf(key, value){w[c][key]=value};

    imqaConf("imqaAgentUse", true);
    imqaConf("projectKey", "User project key");
    if ((w[_wk] !== undefined && w[_wk][_mh] !== undefined) || w[_b] !== undefined)
      w[_wv](w);
    else w[_w](w);
})(window, 'imqaClientConfig', 'IMQAWebviewMain', 'IMQAWebMain', 'webkit', 'messageHandlers', 'ImqaBridge')
</script>

Last updated