It is possible to send, in real-time, users who subscribe or unsubscribe to the newsletter to Blendee and immediately have the ability to track the activities carried out by the customer.
Among the events available on our tracking system you can find: trkNewsletterSubscription which accepts the following parameters:
- userEmail – emails to be added to newsletter subscribers
- contactName – name
- contactSurname – surname
- userNewsletterFlag – value of the f_ricevi_newsletter flag (“true” or “false”)
- userCommercialComunicationFlag – value of the f_ricevi_comunicazioni_commerciali flag (“true” or “false”)
- NewsletterLists – string containing the list of newsletter lists to which it should be added separated by | .
- formDoubleOptIn – true or false depending on whether or not you want to send a confirmation email for the double optin
- callback – javascript function to be invoked when the Blendee call returns, so that the submit is made only after Blendee has recorded the data.
To activate the subscription option, simply enter the following code:
_sbnaq.push(["trkNewsletterSubscription", formEmail, formContactName, formContactSurname, formNewsletterFlag, formCommercialComunicationFlag, formListeNewsletter, formDoubleOptIn, function() { $('#ID-OF-YOUR-FORM').submit(); }]);
- userEmail – email da disiscrivere
- listeNewsletter – stringa contenente l’elenco di liste newsletter a cui aggiungerlo separate da | . Nel caso venga inserita una stringa vuota l’utente verrà disiscritto da qualsiasi invio di newsletter.
- type – 1 = newlsetter, 2 = comunicazioni commerciali, 3 = tutto
- callback – funzione javascript da richiamare al ritorno della chiamata Blendee, in modo da effettuare il submit solamente dopo che Blendee ha registrato il dato
Note: Form buttons must all <be buttons> and not <submit>. This allows the data to be passed to Blendee before the submission to your portal takes place.
Let’s see how to activate this feature with an example as well.
Let’s take the following form, which could be one of the forms on a site, to collect newsletter subscriptions.
Whose html code is as follows:
<form id="form_25517" class="appnitro" method="post" action="">
<div class="form_description">
<h2>Demo Newsletter Subscription</h2>
<p></p>
</div>
<ul>
<li id="li_1">
<label class="description" for="element_1">Email </label>
<div>
<input id="element_1" name="element_1" class="element text medium" type="text" maxlength="255" value="">
</div>
</li>
<li id="li_2">
<label class="description" for="element_2">Contatto </label>
<span>
<input id="element_2_1" name="element_2_1" class="element text" maxlength="255" size="8" value="">
<label>Nome</label>
</span>
<span>
<input id="element_2_2" name="element_2_2" class="element text" maxlength="255" size="14" value="">
<label>Cognome</label>
</span>
</li>
<li id="li_3">
<label class="description" for="element_3">Privacy </label>
<span>
<input id="element_3_1" name="element_3_1" class="element checkbox" type="checkbox" value="1">
<label class="choice" for="element_3_1">Iscrizione newsletter</label>
<input id="element_3_2" name="element_3_2" class="element checkbox" type="checkbox" value="1">
<label class="choice" for="element_3_2">Comunicazioni commerciali</label>
</span>
</li>
<li class="buttons">
<input id="saveForm" class="button_text" type="button" name="submit" value="Submit" onclick="sendToBlendee();">
</li>
</ul>
</form>
In order to send the data to Blendee, when the user clicks on the button (remember that the tag must be
function sendToBlendee() {
var formEmail = $('#element_1').val();
var formContactName = $('#element_2_1').val();
var formContactSurname = $('#element_2_2').val();
var formNewsletterFlag = "false";
var formCommercialComunicationFlag = "false";
var formListeNewsletter = "";
var formDoubleOptIn = false;
if ($('input[name="element_3_1"]:checked').length > 0) {
formNewsletterFlag = "true";
}
if ($('input[name="element_3_2"]:checked').length > 0) {
formNewsletterFlag = "true";
}
_sbnaq.push(["trkNewsletterSubscription", formEmail, formContactName, formContactSurname, formNewsletterFlag, formCommercialComunicationFlag, formListeNewsletter, formDoubleOptIn, function() {
$('#form_25517').submit();
}]);
}
N.B. We remind you that the tracking of the user registration takes place automatically if the Blendee form made available in the Website -> Form section is used
Thanks for contributing!