Publishing an Experience on your website
Let's explore how to publish your experience on your website using either a Javascript code or HTML.
Iframe JavaScript
- When you finalise your experience in the last step "confirm" you can choose how to publish your experience
- Select iFrame
- Define the height of your iFrame under Setup
- Copy the JavaScript
- Copy-paste the JavaScript into your Webpage / CMS
- Test the experience on desktop and mobile to make sure it renders properly

For an iFrame integration we always recommend to use the JavaScript code as it offers more flexibility with functionality such as height of page.
HTML iFrame
It is also possible to use standard HTML code to iFrame your experience. In this case you can simply add the URL of your experience into an HTML iFrame code.
- When you finalise your experience in the last step "confirm" you can choose how to publish your experience
- Update the HTML iFrame code with your Experience URL: <p><iframe style='border-style: none;' src='https://YOUREXPERIENCEURL' height='750' width='100%' ></iframe></p>
- Insert the HTML code into your Webpage / CMS
- Test the experience on desktop and mobile to make sure it renders properly
In this case it is not possible to update the Height of the iFrame directly from Odicci.
Pop-Up Javascript
Odicci experiences can also be published as pop-ups in your website.
- When you finalise your experience in the last step "confirm" you can choose how to publish your experience
- Select Pop-Up
- Setup your Pop-Up (pop-up on exit intent, type of pop-up, pages where it should show, ...)
- Copy the JavaScript
- Copy-paste the JavaScript into your Webpage / CMS
- Test the experience on desktop and mobile to make sure it renders properly

There are lots of options available for the Odicci Pop-Ups.
Using Google Tag Manager for Deployment
Odicci experiences can also be added using GTM:
- Create a New Custom HTML Tag in GTM
- Copy the below code into your tag:
<script>
(function() {
// Create the iframe element
var iframe = document.createElement("iframe");
iframe.style.borderStyle = "none";
iframe.src = "https://campaign.odicci.com/#/example";
iframe.height = "750";
iframe.width = "100%";
// Try to insert it into the first element with class "content"
var target = document.querySelector(".content");
if (target) {
target.appendChild(iframe);
} else {
// If the element doesn't exist yet, keep checking until it appears
var checkExist = setInterval(function() {
var target = document.querySelector(".content");
if (target) {
target.appendChild(iframe);
clearInterval(checkExist);
}
}, 100); // check every 100ms
}
})();
</script>
- Replace the iframe.src URL with your experience URL found on the confirm screen in Odicci
- Replace the ".content" with the div class you'd like to inject the experience within
- Set your GTM trigger for the page/pages you'd like to display the experience
- Save and preview
- Publish in GTM when ready