Basic Optivo Pixel Implementation

Purpose

The Optivo library is a lightweight, easy to use, javascript codebase used to allow tracking conversions based on leads sent to your website.

Simply follow this tutorial to get tracking enabled on your site in 5 minutes.

What you’ll need

  • The ability to add some javascript code to your website OR access to google tag manager which is already enabled on your website
  • The ability to add conversion code to your checkout success page(s).

Basic Installation

  1. Add the code snippet below across your entire site just before the closing body tag.
<script type="text/javascript">

    var optivoScript = document.createElement('script');
    optivoScript.src = "https://id.optivo.digital/id.v1.min.js";
    optivoScript.defer = true;

    optivoScript.onload = function () {
        window._OPTIVO.init();
    };

    document.head.appendChild(optivoScript);

</script>
 
  1. For your conversion success page(s), add the following code instead (e.g. after taking successful payment, your customer ends on a final success page URL ‘/checkout/success’):
<script type="text/javascript">
    var optivoScript = document.createElement('script');
    optivoScript.src = "https://id.optivo.digital/id.v1.min.js";
    optivoScript.defer = true;

    optivoScript.onload = function () {
        window._OPTIVO.init().then(function () {
            window._OPTIVO.conversion();
        });
    };

    document.head.appendChild(optivoScript);
</script>
 

Verifying Installation

Once you have added the code snippets above to your website and deployed the changes, it would be a good idea to visit the pages it has been enabled on.

Go to a page you have the tracking enabled on, then inspect the browser console window (F12 in Chrome) and look for a line output that should read the following:

[OPTIVO]: Active on this page.

Of course reach out to us if you need help at any stage.

Library Hosting

You can checkout the tag library at the following URL if you wish to inspect it’s function: 
https://id.optivo.digital­/id.v1.min.js