Technical web page JavaScript snippet deployment


This document describes how to deploy Toonimo inside your website.
The code snippet is generated by the Toonimo Solution Delivery team assigned to your account (the team also supports the code deployment process). This document also outlines the technical means of sending advanced parameters to the Toonimo servers, which are deployed to trigger more advanced use cases.

Why do I need to do this?

The snippet triggers the browser to “talk” to our servers in order to enable the website guidance. This forms the only real technical element of deploying the Toonimo solution. The code itself is a small code snippet that needs to be put inside all of the pages in the target area.

What does it do?

When a page that contains the Toonimo snippet is loaded by an end user’s browser, it loads Toonimo’s JS code from CDN or from the browser’s cache (if already loaded before).
Then it checks whether a walkthrough should be played on this page, and only if it should, it prepares for walkthrough execution, starts buffering the relevant sound and shows a trigger button.

How do I implement it?

Standard implementation
Toonimo snippet is a simple script tag that should be put right before the body closing tag “</body>” of your html page:

The snippet should ideally be added to your global website’s footer tag in order to get better analytics.
If it’s not possible to add it to all of the pages on your website, you can add it only to the pages that you are intending to use Toonimo on.

Non standard implementations

  • It is possible to implement the snippet in WordPress pages.
  • It is possible to implement the snippet inside your own JS file. The only thing you need to take care of, is that the file loads after the body was loaded (load your file after document.ready event or you can simply put it inside the body tag instead of the head tag).
  • It is possible to implement the snippet inside Google Tag Manager:

Advanced - some more technical details

Loading options
The Toonimo code is loaded asynchronously and has three configurable server-side options to decide how the code is loaded:

  • jQuery’s Document Ready - The Toonimo assets will only run once the page DOM is ready for JavaScript code to execute.
  • JavaScript’s Window Load - The Toonimo assets included inside “window.load” will run once the entire page (images or iframes), not when the DOM, is ready.
  • Interactive mode readyState - The Toonimo assets will load once the webpage has finished parsing but still loading sub-resources.

Custom Page Events

Toonimo provides the ability to pass any custom information from the webpage to the Toonimo service. This information can be used to trigger custom use cases.
For example:
Toonimo.Loader.setApiVar('age', 33);
Toonimo.Loader.setApiVar(gender', ‘MALE’);


Toonimo provides an API in order to be able to control the walkthrough execution and to receive events about the walkthrough progression, which can be used to send self-analytics or to make an advanced integration of the walkthrough to the page’s behavior.
For more details, ask your success manager about it.

Example snippet:

Notice, this is just a demo snippet.
Each customer/project has a different snippet.

var TMO_dec=decodeURIComponent||unescape; var TMO_scr = document.createElement('script'); TMO_scr.async = true; var TMO_scrT = TMO_dec('%0A%2F%2A%20Powered%20by%20Toonimo%20%2A%2F%0A%28function%2'); try{TMO_scr.innerHTML=TMO_scrT}catch(ex){try{TMO_scr.text=TMO_scrT}catch(ex){try{TMO_scr.textContent=TMO_scrT}catch(ex){}}} document.body.appendChild(TMO_scr);

If you would like any additional information about the Toonimo snippet implementation, API details or variable parameters, please contact us on: