It is possible to send, in real-time, users who subscribe to Lead Generation forms to Blendee and have, right away, the ability to track the activities carried out by the customer.
This is very useful in content sites or in general in sites where the concept of registered user is envisaged.
However, it is possible to associate a user to submit a form by also recording the personal data (if present in the form fields).
To do this, it is necessary to intercept the submit of the form and insert a custom JS code to allow the execution of this action.
Here’s sample code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/blueimp-md5/2.10.0/js/md5.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
</head>
<body>
<form id="form">
Nome: <input type="text" name="nome" value="Mario" /><br>
Cognome: <input type="text" name="cognome" value="Rossi" /><br>
Email: <input type="text" name="email" value="mario.rossi@gmail.com" /><br>
<input type="submit" value="Invia" />
</form>
</body>
<script type="text/javascript">
$(function() {
$('#form').on("submit",function(e) {
e.preventDefault();
var nome = $('input[name=nome]').val();
var cognome = $('input[name=nome]').val();
var email = $('input[name=nome]').val();
var uid = md5(email);
var comunicazioniCommerciali = false;
var iscrizioneNewsletter = false;
_sbnaq.push(['trkUserRegistration', uid, email, nome, cognome, iscrizioneNewsletter, comunicazioniCommerciali]);
});
});
</script>
</html>
Was this content useful?
Thanks for contributing!