Installation and Initialization
BotManager Browser Agent can be installed in two ways.
Prerequisites
Before installing the agent, check the following information in the BotManager console:
- Select Domain: Select the domain where you want to install the agent.
- Check Configuration Values: Check the following values provided in the console:
TENANT_ID: Customer identification IDDOMAIN: Domain nameENGINE_URL: Detection server URLAGENT_URL: Agent file URL
Installation Methods
Method 1: Direct Insertion in HTML File
Insert the installation code directly into the <head> tag of the page. This is a simple and quick method to apply.
Below is example code. Values within {} brackets are automatically generated and provided in the customer-specific console.
<script>
(function(cfg) {
cfg.tenantId = '{{ TENANT_ID }}';
cfg.domainName = '{{ DOMAIN }}';
cfg.customId = '{{ USER_CUSTOM_ID }}'; // optional
cfg.serverUrl = '{{ ENGINE_URL }}/api/v1/macro';
})(window['BotManager-config'] || (window['BotManager-config'] = {}));
</script>
<script src="{{ AGENT_URL }}/agents/client/javascript/botmanager-browser-agent.js" async></script>
Method 2: Insertion in Common JavaScript File
You can apply the installation code by adding it to a JavaScript file commonly used across the site. This method is efficient for maintenance and management.
// Insert in common JavaScript file
(function(cfg) {
cfg.tenantId = '{{ TENANT_ID }}';
cfg.domainName = '{{ DOMAIN }}';
cfg.customId = '{{ USER_CUSTOM_ID }}'; // optional
cfg.serverUrl = '{{ ENGINE_URL }}/api/v1/macro';
})(window['BotManager-config'] || (window['BotManager-config'] = {}));
// Download and execute library
var scriptBM = document.createElement('script');
scriptBM.src = '{{ AGENT_URL }}/agents/client/javascript/botmanager-browser-agent.js';
scriptBM.async = true;
document.head.appendChild(scriptBM);
customId Configuration
customId is an optional configuration value that can be specified as a value that can identify users in the service page.
Examples:
- User ID when logged in through login authentication
- Session value when logged in through login authentication
Key Features and Benefits
-
BotManager Accessor Management Console Integration:
- When
customIdis set, you can check detection information based on specific users identifiable within the service.
- When
-
Multi-Device Blocking:
- When a user using the same
customIdaccesses through multiple devices, blocking settings are applied equally to those devices. - This prevents blocked users from using multiple devices.
- When a user using the same
Initialization Verification
After installation is complete, you can check the following in the browser console:
// Check if BotManager object is loaded globally
console.log(window.BotManager); // BotManager object should be output
Next Steps
After installation is complete, refer to the following documents:
- Configuration Options: Check various configuration options
- API Reference: How to use detection functions
- Troubleshooting: Common problem solving