Form tracking: Sleeknote or Drift

Updated by Rune Juul-Stokholm

Tracking forms using Sleeknote or Drift

Sleeknote

If you are using Sleeknote to collect leads, then here is how you can ensure we track the Sleeknote popups.

Paste the script immediately after the <head> tag on each page of your site.
​<script>
document.addEventListener('sleekNote', function (e) {
if (e.data.type == 'submit' && window.analytics) {
window.analytics.identify(null, { email: e.data.email });
window.analytics.track('form-submit');
}
}, false);
​</script>

You might change the event name from 'form-submit' to what makes sense
You can read more information about how Sleeknotes Event Emitter works here.

Drift

If you have Drift chat on your website and want to identify users when an email is captured as part of a campaign, then, here is a snippet you can use to ensure the user is identified within Dreamdata.

Note: The script has to be loaded after your Drift script. For example, you could paste the script below as is just after your Drift script in your header, which will identify users automatically and throw a form-submit event.
​<script>
drift.on("emailCapture", function(payload) {
if (payload.data && payload.data.email && window.analytics) {
window.analytics.identify(null, {
email: payload.data.email
});
window.analytics.track('form-submit');
}
});
​</script>

You can read more about how to receive information from Drift here.


How did we do?