Ensighten
  • 13 Dec 2023
  • 1 Minute to read
  • Dark
    Light

Ensighten

  • Dark
    Light

Article Summary

Summary

The Ensighten library (Bootstrap.js file) includes several helpful functions and frameworks that assist in implementing tags across a site. To load the Jornaya javascript via Ensighten we can utilize .loadScriptCallback().

Need additional support?

If you have any questions or require additional assistance, please contact support@jornaya.com


Instructions

1. Using the .loadScriptCallback() function

The loadScriptCallback function inserts a script tag into the current web page asynchronously and executes custom JavaScript code (callback) once the script file has completed downloading.

Parameters

  • @param1 {string} - URL of the JavaScript file to insert into the page
  • @param2 {function} - JavaScript code to execute after the script tag downloads and executes
  • @param3 {boolean} - Optional, default false. Determines whether or not to insert a script with the same src already on the page (false = does not re-insert the script if the script is already on the page)

Example

Insert a script file and then print the console log message once the file is downloaded.

Bootstrapper.loadScriptCallback('//www.example.com/exampleScript.js';, function() {
   console.log('File has been downloaded');
});

2. How to inject the Jornaya Script using .loadScriptCallback()

Create URL
Be sure to replace the "//create..." url in the example below with your Jornaya Campaign script (obtained from within your account in the Jornaya Member Portal). To get your Jornaya Campaign Code, please see our Getting Started Guide.


Bootstrapper.loadScriptCallback('//create.lidstatic.com/campaign/YOUR_LOWERCASE_JORNAYA_CAMPAIGN_KEY_HERE.js?snippet_version=2';, function() {
   console.log('LeadiD Script Campaign has been injected');
});

3. Confirm the script is working properly

  1. Save all changes and open the website in a new tab to confirm everything is working properly.
  2. Follow the steps in the Create Implementation Testing to confirm the integration is working as expected.

Was this article helpful?

What's Next