Manual Initialization

Let's see how to initialize Jimo whenever you want to

By default, Jimo will run automatically when a user visits a page where the snippet is installed. But you may want to prevent this and have control over when Jimo should start working.

Disable automatic initialization

If you want to prevent the script from loading automatically, you will have to add JIMO_MANUAL_INIT to your snippet integration (see the example below).

    window.jimo = [];
    (function(j,i,m,o) {
        var s = document.createElement("script");

        s.type = "text/javascript";
        s.async = true;
        s.src = "";

        j['JIMO_MANUAL_INIT'] = true; // <- Add this

Initialize Jimo

To initialize Jimo, you will have to call the following command


It's optionnal, but if you'd like to kill Jimo, you will have to call the following command


Passing commands before Jimo is initialized

Even if Jimo is not yet initialized, we support buffering. In fact, you can still push commands that will be executed once you initialize Jimo.

With manual initialization, you should push commands before initializing Jimo to make sure they are executed in the correct order after calling jimoInit()

Here is a simple example that shows how to identify a user and then initialize manually Jimo

function launchJimo(user) {
    // Buffer some commands before initialize
    window['jimo'].push(['do', 'identify', []]);
    window['jimo'].push(['set', 'user:name', [user.username]]);
    // Initialize Jimo

Last updated