Skip to main content

Troubleshooting

This guide covers common issues and solutions when using BotManager Browser Agent.

Common Issues

BotManager Object Not Loaded

Symptoms: window.BotManager is undefined.

Causes:

  • Script has not been loaded yet.
  • Script path is incorrect.
  • Network error occurred.

Solutions:

  1. Check script loading:
// Check script loading
if (typeof window.BotManager === 'undefined') {
console.error('BotManager is not loaded.');
}
  1. Check script path:
<!-- Check correct script path -->
<script src="{{ AGENT_URL }}/agents/client/javascript/botmanager-browser-agent.js" async></script>
  1. Check script loading in Network tab:
    • In the browser developer tools Network tab, check if the botmanager-browser-agent.js file was successfully loaded.

detectPage Function Not Working

Symptoms: No response when calling BotManager.detectPage().

Causes:

  • BotManager object has not been initialized yet.
  • Script is loaded asynchronously and is not ready yet.

Solutions:

// Wait for script to load before using
function waitForBotManager(callback) {
if (window.BotManager && typeof window.BotManager.detectPage === 'function') {
callback();
} else {
setTimeout(() => waitForBotManager(callback), 100);
}
}

waitForBotManager(() => {
BotManager.detectPage('/api/login-endpoint', (result) => {
performLogin();
});
});

Detection Request Not Sent

Symptoms: Auto detection does not work when the page loads.

Causes:

  • cfg.detectOnLoad is set to false.
  • Network timeout occurred.

Solutions:

  1. Check configuration:
// Check detectOnLoad configuration
(function(cfg) {
cfg.detectOnLoad = true; // Enable auto detection
})(window['BotManager-config'] || (window['BotManager-config'] = {}));
  1. Increase network timeout:
cfg.networkTimeout = 5000; // Increase timeout time

Server-Side Agent Integration Not Working

Symptoms: Server sent x-botmanager-location header but redirection does not occur.

Causes:

  • Browser Agent is not loaded.
  • Header name is incorrect (case-sensitive).

Solutions:

  1. Check Browser Agent loading:
if (window.BotManager) {
console.log('Browser Agent is loaded.');
}
  1. Check header name:
    • Server must send the header as x-botmanager-location (lowercase).

Developer Tools Detection Not Working

Symptoms: Developer tools are not detected when opened.

Causes:

  • cfg.detectDevTools is set to false.

Solutions:

cfg.detectDevTools = true; // Enable developer tools detection

Additional Support

If the issue is not resolved, check the following:

  1. Check error messages in browser console
  2. Check requests/responses in Network tab
  3. Check configuration in BotManager console