Embarke Conversion Tracking

Conversion tracking lets you see how Embarke optimization impacts your bottom line – either in direct purchases, or by total number of conversions, such as signups or applications. With a few minor updates to your website, you can start tracking this in just a few minutes.

To setup conversion tracking, you’ll need to install a small Javascript snippet on your website on each page that could potentially be visited from an email link. Typically you’d do this in a site-wide template in the footer of the page. Here is the code you’ll need. You just need to change the highlighted area to use your Embarke App Id (get this from the Settings tab of your Embarke portal).

<!-- Embarke conversion tracking -->
<script type="text/javascript">
    var _mbrk = _mbrk || [];
    _mbrk.app = 'REPLACE WITH YOUR EMBARKE APP ID';	    (function() {
        _mbrk.track = function() { _mbrk.push(["track"].concat(Array.prototype.slice.call(arguments,0)) )};
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.async = true;
        script.src = "//devv24ks49cs.cloudfront.net/embarke.min.js";
        var firstScript = document.getElementsByTagName('script')[0];
        firstScript.parentNode.insertBefore(script, firstScript);
    })();
</script>

To tell Embarke when a conversion actually happens, you’ll also need to include one more line of Javascript on “conversion” pages (e.g. after checkout, signup, or subscription) below the above script. This line can specify the type of conversion and the amount (a decimal number). Here’s an example with this new line added to track a purchase for 50 dollars (or your preferred currency).

<!-- Embarke conversion tracking -->
<script type="text/javascript">
    _mbrk.track( { name: "Purchase", amount: 50 } );</script>