Back to Support

CANDDi tracker event subscription

Published 02 Nov 2020 by Ellice Eadie, CANDDi
Read this in less than 1 minute

If you’re into the techy stuff (erm, why?) then you’ll be glad to know CANDDi Tracker event subscriptions are a mechanism for onsite JavaScript to monitor the internal happenings within the CANDDi Tracker.

This is useful for enabling third-party JavaScript to react based on the data or activities being tracked, for example: firing a Google Analytics conversion if the CANDDi Capture has been completed.

How does it work?

To do this, register a call-back function (and the type of event to listen to, see §3 for a list of types). Note the Type is case-sensitive so track.download is not the same as Track.Download.

<script>
canEvents = canEvents || [];
_canEvents.push(`"track.download",function(){alert("Download Tracker")});
</script>

Each time a download occurs then the call-back function will be executed (and in this instance an alert will be raised on screen).

Got more questions? Speak to our fellow techies at help@canddi.com