# Manual initialization

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).

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

        s.type = "text/javascript";
        s.async = true;
        s.src = "https://undercity.usejimo.com/jimo-invader.js";
        j['JIMO_PROJECT_ID'] = "YOUR_PROJECT_ID";

        j['JIMO_MANUAL_INIT'] = true; // <- Add this
        
        document.getElementsByTagName("head")[0].appendChild(s);
    })(window);
</script>
```

***

## Initialize Jimo

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

```javascript
window.jimoInit()
```

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

```javascript
window.jimoKill()
```

***

## 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.

{% hint style="info" %}
With manual initialization, you should push commands **before** initializing Jimo to make sure they are executed in the correct order after calling `jimoInit()`
{% endhint %}

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

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.usejimo.com/docs/for-developers/for-developers/sdk-guides/manual-initialization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
