Install our SDK
Requirements
To install our widget, first, sign in to our dashboard. If you don't have an account, feel free to request access.
Load the snippet on your website
Copy the snippet code.
Replace
"YOUR_PROJECT_ID_HERE"with your project ID.Paste the updated snippet into the
<head>section of your website.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Your website</title>
<!-- Paste Jimo snippet here -->
<script>
(function(j,i,m,o) {
if (j["jimo"] != null) {
return;
}
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "https://undercity.usejimo.com/jimo-invader.js";
j['jimo'] = [];
j['JIMO_PROJECT_ID'] = "YOUR_PROJECT_ID_HERE";
document.getElementsByTagName("head")[0].appendChild(s);
})(window);
</script>
</head>
<body>
</body>
</html>Failing to replace the project ID will prevent the SDK from working correctly.
When copying the snippet code to your website, make sure to replace "YOUR_PROJECT_ID_HERE"with your actual project ID.
You can find your project ID in the dashboard under Settings > General.
Command buffering
The snippet creates a global command queue (j['jimo'] = []) before the Jimo script itself loads. Any SDK command you push is stored in this queue and processed once Jimo initializes: the identify command runs first, then the other queued commands are applied in order.
In practice, you can safely push your set commands and finish with identify right after the snippet, without waiting for Jimo to be ready. See Identify users for the recommended pattern.
Advance integrations
If you are using a framework, please check the corresponding guide just below
Integrate Jimo in your React.js app
Here is a way to load the snippet with React:
If you are using Typescript, you can find additional typings below.
Integrate Jimo in your Next.js app
Here is a way to load the snippet with Next.js:
If you are using Typescript, you can find additional typings bellow.
Integrate Jimo in your Vue app
Here is a way to load the snippet with Vue
If you are using Typescript, you can find additional typings bellow.
Integrate Jimo in your Angular app
Here is a way to load the snippet with Angular:
If you are using Typescript, you can find additional typings bellow.
A performance impact may be seen, with Angular 18 and bellow, due to the Angular Change Detection mechanism. In order to prevent this, make sure to encapsulate each call to the Jimo SDK method like so
Integrate Jimo using Google Tag Manager
In this notice, we will see how to install Jimo using Google Tag Manager. This feature allows you to create a tag in one of your containers automatically. You can choose only to create the tag or also publish the tag to your Google Tag Manager workspace and make it live.
Go to the installation page
Access Settings > Installation and locate the “Setup with Google Tag Manager” section.
Setup Google Tag Manager
1.Click on Connect to “Google Tag Manager”
2.Select a GTM account.
3.Select a GTM container
4.Click to create the tag If you want to publish it at the same time, click on “Create and publish tag for me now” Note that this might require extra permissions from your Google Tag Manager Administrator
Here is an example of a GTM setup:

You can install Jimo using the Jimo Action Integration.
Follow the Get Started section of the integration to inject the script using Segment.io.
Typescript
After being injected into your app, Jimo adds some properties to the window object.
To prevent linter errors in your project, update (or create) your global.d.ts file and add the following types
Domain Whitelisting
To prevent CSP (Content Security Policy) errors or if your platform requires some sort of domain whitelisting to load external resources, you will need to add the following domains for Jimo to work properly :
Here is an example of setup incluging CSP per directives :
Install with Google Tag Manager
Integrate Jimo using Google Tag Manager
In this notice, we will see how to install Jimo using Google Tag Manager. This feature allows you to create a tag in one of your containers automatically. You can choose only to create the tag or also publish the tag to your Google Tag Manager workspace and make it live.
Go to the installation page
Access Settings > Installation and locate the “Setup with Google Tag Manager” section.
Setup Google Tag Manager
Click on Connect to “Google Tag Manager”
Select a GTM account.
Select a GTM container
Click to create the tag If you want to publish it at the same time, click on “Create and publish tag for me now” Note that this might require extra permissions from your Google Tag Manager Administrator
Here is an example of a GTM setup:

Self Hosting
You can host the javascript snippet loaded into your application in order to increase the control you have over which version of Jimo runs in your app.
Please keep in mind that self hosting our snippet might increase the risk of bugs since you will not get the latest updates and bug fixes automatically.
We highly recommend to update your files at least once per month.
Download our javascript sources
You will have to host two javascript files. You can find and download them directly from their public URLs
Update your snippet setup
In order for Jimo to start using your self hosted scripts, please find the following line in your Jimo setup
and replace it with
Finally, please add the following window variable
You are all setup!
Check that everything works normally
Follow this quick checklist to make sure everything is correctly setup.
In your browser, open a page where Jimo is installed
Open the browser Dev Tool and go to the Network tab
Use the JS filter to see only requests that loads a javascript file
Look for a request with this url
https://your-domain.com/jimo-invader.jsLook for a request with this url
https://your-domain.com/jimo-main.js
Upgrade your version
In order to upgrade your version you only need to Download our javascript sources again and update your hosted files.
Next step: identify your users
Once the snippet is live, set up user identification to link sessions to your own user IDs and unlock segmentation. Follow the Identify users guide.
Last updated