Documentation
Complete guides and references for MetricPoints
Configuration
API Key Setup
Your API key is the primary authentication method for MetricPoints. It's automatically associated with your project and team.
Full Configuration Parameters Example
<script>
(function() {
var script = document.createElement('script');
script.src = 'https://metricpoints.com/js/metric-points-error-tracker.min.js';
script.async = true;
script.onload = function() {
window.MetricPointsErrorTracker.init(new MetricPointsErrorTrackerConfig({
apiKey: null, // The API key for the error tracker
endpoint: 'https://metricpoints.com/api/error-reports', // The endpoint for the error tracker
performanceEndpoint: 'https://metricpoints.com/api/performance-sessions', // The endpoint for performance sessions
autoStart: false, // Set to true to auto-start the error tracker
autoStartDelay: 1000, // Set to the number of milliseconds to delay the auto-start of the error tracker
environment: 'default', // Which environment is the error tracker running in?
maxSendingEvents: 10000, // Set to 0 for unlimited events (events includes errors, metrics, and performance data)
maxSendingFails: 1000, // Set to 0 for unlimited sending fails (not recommended)
diagnosticLogging: false, // Set to true to enable diagnostic logging (only enable for development and testing - not recommended for production)
silent: true, // Set to true to disable console logging (only enable for development and testing - not recommended for production)
errorLogging: true, // Set to true to log errors to the console (only enable for development and testing - not recommended for production) - this overrides the silent setting
userTracking: {
enabled: true, // Set to false to disable user tracking
fingerprinting: true, // Set to false to disable browser fingerprinting
localStorage: true, // Set to false to disable localStorage persistence
privacyMode: false, // Set to true for enhanced privacy (reduces fingerprinting accuracy)
},
performance: {
enabled: true, // Set to false to disable performance monitoring
sendToPerformanceAPI: true, // Send performance data to performance API
memoryCheckInterval: 30000, // Set to the number of milliseconds to check for memory usage
},
sessionReplay: {
enabled: true, // Set to false to disable session replay
mouseTracking: true, // Set to false to disable mouse tracking
clickTracking: true, // Set to false to disable click tracking
maxSendingEvents: 1000, // Set to 0 for unlimited events (session replay includes mouse movements, clicks, scroll positions, keypresses, focus changes, url changes, form interactions)
sendToPerformanceAPI: true, // Send session replay to performance API
},
network: {
enabled: true, // Set to false to disable network monitoring
}
}));
};
document.head.appendChild(script);
})();
</script>
Configuration Parameters
Detailed explanation of all available configuration options:
Basic Configuration
apiKey
Your MetricPoints API key for authentication. Required for all tracking functionality.
environment
Environment identifier (e.g., 'production', 'staging', 'development'). Default: 'default'
endpoint
The API endpoint for error reports. Not recommended to change. Default: 'https://metricpoints.com/api/error-reports'
performanceEndpoint
The API endpoint for performance sessions. Not recommended to change. Default: 'https://metricpoints.com/api/performance-sessions'
Auto-Start Configuration
autoStart
Automatically start tracking when the script loads. Default: false
autoStartDelay
Delay in milliseconds before auto-starting. Default: 1000
Event Limits
maxSendingEvents
Maximum number of events to send (errors, metrics, performance data). Set to 0 for unlimited. Default: 10000
Note: This is the total number of events to send, not the number of events to send per minute.
maxSendingFails
Maximum number of failed send attempts before stopping (these are failures to send data to the API). Set to 0 for unlimited (not recommended). Default: 1000
Note: This is the total number of failed send attempts, not the number of failed send attempts per minute.
Logging Configuration
diagnosticLogging
Enable detailed diagnostic logging. Only use for development/testing. Default: false
silent
Disable all console logging. Only use for development/testing. Default: false
errorLogging
Log errors to console. Overrides silent setting. Only use for development/testing. Default: true
User Tracking Configuration
userTracking.enabled
Enable user tracking functionality. Default: true
userTracking.fingerprinting
Enable browser fingerprinting for user identification. Default: true
userTracking.localStorage
Use localStorage for user data persistence. Default: true
userTracking.privacyMode
Enable enhanced privacy mode (reduces fingerprinting accuracy). Default: false
Performance Tracking Configuration
performance.enabled
Enable performance monitoring. Default: true
performance.sendToPerformanceAPI
Send performance data to the performance API. Default: true
performance.memoryCheckInterval
Interval in milliseconds for memory usage checks. Default: 30000
Session Replay Configuration
sessionReplay.enabled
Enable session replay functionality. Default: true
sessionReplay.mouseTracking
Track mouse movements for session replay. Default: true
sessionReplay.clickTracking
Track click events for session replay. Default: true
sessionReplay.maxSendingEvents
Maximum session replay events to send (mouse movements, clicks, scrolls, keypresses, etc.). Set to 0 for unlimited. Default: 1000
sessionReplay.sendToPerformanceAPI
Send session replay data to performance API. Default: true
Network Monitoring Configuration
network.enabled
Enable network request monitoring. Default: true