Skip to main content

Install Ocular on your website

Add the following code to every page where you want Ocular to be available:

index.html
<!-- Insert between the body tags on every page of your site -->
<script>
(() => {
const ocularSolutionScript = document.createElement('script')
ocularSolutionScript.setAttribute('type', 'text/javascript')
ocularSolutionScript.setAttribute('name', 'ocular-solution-widget')
ocularSolutionScript.setAttribute('data-modules', 'call')
ocularSolutionScript.setAttribute('src', 'https://widget.ocularsolution.com/service/ocular/js/ocular-widget.js?v=1.1.1')
ocularSolutionScript.setAttribute('code', 'your-code')
document.body.appendChild(ocularSolutionScript)
})()
</script>
Attention

It is important that the widget is present on every page of your website.

Install using Google Tag Manager​

You will need to create a custom HTML tag. Do the following:

  • Sign in to your Google Tag Manager account.
  • Select the account where you will install the widget.
  • Click Tags > New.
  • Set the tag title to Ocular Solution Widget
  • Click Tag Configuration and select Custom HTML.
  • Copy the tag code provided above and paste it into the HTML field
  • Click Triggering and select All pages
  • Click Save

In the Google Tag Manager dashboard, click Submit to publish the new changes to the website