Checking Digital Experience Analytics is Ready

In some cases, JavaScript code needs to be executed after DXA has been fully loaded. This event allows custom code to be executed once this condition has occurred. You can bind one or more callbacks which will be executed in the same order they have been bound.
decibelInsight('ready', callback);

Argument

callback (function): A callback containing any valid JavaScript code.

Example

// Log a message in the console once Decibel is fully loaded. 
decibelInsight('ready', function () { 
console.log('Decibel loaded!');
});