Integration Functions
The following functions can be used to support integrations between Decibel and other analytics tools.
Lead ID
decibelInsight('getLeadId');
Returns Decibel Lead ID for the current session.Return
(string) Decibel Lead ID
Example
// Add the Decibel Lead ID to the JavaScript data layer.
dataLayer.leadId = decibelInsight('getLeadId');
Session ID
decibelInsight('getSessionId');
Returns Decibel session ID for the current session.Return
(string) Decibel Session ID
Example
// Add the Decibel Session ID to the JavaScript data layer.
dataLayer.sessionId = decibelInsight('getSessionId');
Collection status check
decibelInsight('isCollecting');
Determines if Decibel is successfully collecting data.Returns
(Boolean) Decibel collection status:
- true if Decibel is collecting data.
- false if no data is currently being collected.
- null if Decibel is not yet initialized.
Example
// Log a message in the console if Decibel is collecting data.
if (decibelInsight('isCollecting')) {
console.log('Decibel is collecting');
});