Steps to Install your Integration
1. Load mmob javascript snippet
On your web application, add this javascript snippet in the header of the page that will include the mmob deployment.
<!DOCTYPE html>
<html lang="en">
<head>
...
<script src="https://YOUR.APPLICATION.DOMAIN/snippet.min.js"></script>
</head>
...
</html>
2.Place the container that will host the integration
HTML
First, add a target DOM element to your page. This is the containing element that the integration will be injected into. It will be loaded using an iFrame that will have width: 100%
and height: 100%
.
In the example below, we've created an empty div with the id #mmobIntegration
, this will be our target div.
<main class="your-page">
<div id="integration"></div>
</main>
CSS & Layout
You will have to control the integration size by styling your containing div
.
Let's say for example you want to have your integration at full page width and height. You could style your container like so:
width: 100%;
height: 100vh;
3. Load the integration into the container
After the container, call the mmob snippet to load the integration.
Here's an example of what the snippet looks like:
mmob.init({
cp_id: "cp_XXXXXXXXXXXXXXXXXXXXX",
integration_id: "cpd_XXXXXXXXXXXXXXXXXXXXX",
location: "#integration",
integration_server_url: "https://YOUR.APPLICATION.DOMAIN",
view_id: "view_XXXXXX",
uid: unique_user_identifier,
});
⚠️ Note that the above is an example snippet. To configure the data snippet, you will need to remove the example data.
integration_server_url
,cp_id
andintegration_id
will be provided to youlocation
is the id of the DOM object that will contain your integrationview_id
the view to load in the iframe. This is optional if the application only has one view.uid
optional user identifier. This is normally the user's email but can be any unique identifier which you provide. Note: this value must be unique..If no uid is provided a random uid will be assigned to the user. Providing a uid for the user is strongly recommended as the random uid only last a single session.
Therefore, to allow user sessions to persist, you need to provide a uid for each new user that enters your application.
Was this page helpful?