{"id":13686,"date":"2024-03-20T17:04:20","date_gmt":"2024-03-20T16:04:20","guid":{"rendered":"https:\/\/helpcenter.blendee.com\/article\/pass-the-data-of-the-newsletter-subscription-forms-in-real-time-to-blendee\/"},"modified":"2024-03-20T17:04:20","modified_gmt":"2024-03-20T16:04:20","slug":"pass-the-data-of-the-newsletter-subscription-forms-in-real-time-to-blendee","status":"publish","type":"article","link":"https:\/\/helpcenter.streamwise.it\/en\/article\/pass-the-data-of-the-newsletter-subscription-forms-in-real-time-to-blendee\/","title":{"rendered":"Pass the Data of the Newsletter Subscription Forms, in real-time, to Blendee."},"content":{"rendered":"\n<p>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.<\/p>\n\n<p>Among the events available on our tracking system you can find: <b class=\"\">\n  <em>trkNewsletterSubscription<\/em>\n<\/b> which accepts the following parameters:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>userEmail<\/strong> &#8211; emails to be added to newsletter subscribers<\/span><\/li>\n\n\n\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>contactName<\/strong> &#8211; name<\/span><\/li>\n\n\n\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>contactSurname<\/strong> &#8211; surname<\/span><\/li>\n\n\n\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>userNewsletterFlag<\/strong> &#8211; value of the f_ricevi_newsletter flag (&#8220;true&#8221; or &#8220;false&#8221;)<\/span><\/li>\n\n\n\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>userCommercialComunicationFlag<\/strong> &#8211; value of the f_ricevi_comunicazioni_commerciali flag (&#8220;true&#8221; or &#8220;false&#8221;)<\/span><\/li>\n\n\n\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>NewsletterLists<\/strong> &#8211; string containing the list of newsletter lists to which it should be added separated by | .  <\/span><\/li>\n\n\n\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>formDoubleOptIn<\/strong> &#8211; true or false depending on whether or not you want to send a confirmation email for the double optin<\/span><\/li>\n\n\n\n<li><span class=\"\" style=\"font-family: Arial;\"><strong>callback<\/strong> &#8211; javascript function to be invoked when the Blendee call returns, so that the submit is made only after Blendee has recorded the data.<\/span><\/li>\n<\/ul>\n\n<p>To activate the subscription option, simply enter the following code:<\/p>\n\n<pre class=\"wp-block-preformatted\">_sbnaq.push([\"trkNewsletterSubscription\", formEmail,  \n  formContactName, formContactSurname,  \n  formNewsletterFlag, formCommercialComunicationFlag,  \n  formListeNewsletter, formDoubleOptIn,  \n  function() {\n  $('#ID-OF-YOUR-FORM').submit();\n  }]);<\/pre>\n\n<p><\/p><div class=\"\"><span class=\"\" style=\"font-family: Arial;\">Allo stesso modo, nel caso siano presenti della sezioni dedicate alla disiscrizione, \u00e8 possibile passarle, in tempo reale, ad Blendee attraverso la funzione\u00a0<\/span><strong style=\"font-size: revert; color: initial; font-family: Arial;\">trkNewsletterUnsubscribe<\/strong><span style=\"font-size: revert; color: initial; background-color: rgba(0, 0, 0, 0.2); font-family: Arial;\">\u00a0con i seguenti parametri:<\/span><\/div>\n\n<p><\/p><div class=\"\"><ul class=\"MailOutline\"><br\/><li class=\"\"><span class=\"\" style=\"font-family: Arial;\"><b class=\"\">userEmail<\/b>\u00a0&#8211; email da disiscrivere<\/span><\/li><br\/><li class=\"\"><span class=\"\" style=\"font-family: Arial;\"><b class=\"\">listeNewsletter<\/b>\u00a0&#8211; stringa contenente l\u2019elenco di liste newsletter a cui aggiungerlo separate da | . Nel caso venga inserita una stringa vuota l\u2019utente verr\u00e0 disiscritto da qualsiasi invio di newsletter.<\/span><\/li><br\/><li class=\"\"><span class=\"\" style=\"font-family: Arial;\"><b class=\"\">type<\/b>\u00a0&#8211; 1 = newlsetter, 2 = comunicazioni commerciali, 3 = tutto<\/span><\/li><br\/><li class=\"\"><span class=\"\" style=\"font-family: Arial;\"><b class=\"\">callback<\/b>\u00a0&#8211; funzione javascript da richiamare al ritorno della chiamata Blendee, in modo da effettuare il submit solamente dopo che Blendee ha registrato il dato<\/span><\/li><br\/><\/ul><br\/><p><em>Note: Form buttons must all &lt;be buttons&gt; and not &lt;submit&gt;. This allows the data to be passed to Blendee before the submission to your portal takes place.<\/em><\/p><\/div>\n\n<p><\/p>\n\n<p><\/p>\n\n<p>Let&#8217;s see how to activate this feature with an example as well.<br\/>Let&#8217;s take the following form, which could be one of the forms on a site, to collect newsletter subscriptions.<\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><a href=\"https:\/\/helpcenter.blendee.com\/wp-content\/uploads\/2018\/09\/Schermata-2018-09-06-alle-12.52.09.png\" data-lbwps-width=\"652\" data-lbwps-height=\"386\" data-lbwps-srcsmall=\"https:\/\/helpcenter.blendee.com\/wp-content\/uploads\/2018\/09\/Schermata-2018-09-06-alle-12.52.09.png\"><img data-original=\"https:\/\/helpcenter.blendee.com\/wp-content\/uploads\/2018\/09\/Schermata-2018-09-06-alle-12.52.09-300x178.png\" alt=\"\" class=\"wp-image-4924\"\/><\/a><\/figure><\/div>\n<p>Whose html code is as follows:<\/p>\n\n<pre class=\"wp-block-code\"><code>&lt;form id=\"form_25517\" class=\"appnitro\" method=\"post\" action=\"\"&gt;\n\t&lt;div class=\"form_description\"&gt;\n\t\t&lt;h2&gt;Demo Newsletter Subscription&lt;\/h2&gt;\n\t\t&lt;p&gt;&lt;\/p&gt;\n\t&lt;\/div&gt;\n\t&lt;ul&gt;\n\t\t&lt;li id=\"li_1\"&gt;\n\t\t\t&lt;label class=\"description\" for=\"element_1\"&gt;Email &lt;\/label&gt;\n\t\t\t&lt;div&gt;\n\t\t\t\t&lt;input id=\"element_1\" name=\"element_1\" class=\"element text medium\" type=\"text\" maxlength=\"255\" value=\"\"&gt;\n\t\t\t&lt;\/div&gt;\n\t\t&lt;\/li&gt;\n\t\t&lt;li id=\"li_2\"&gt;\n\t\t\t&lt;label class=\"description\" for=\"element_2\"&gt;Contatto &lt;\/label&gt;\n\t\t\t&lt;span&gt;\n\t\t\t\t&lt;input id=\"element_2_1\" name=\"element_2_1\" class=\"element text\" maxlength=\"255\" size=\"8\" value=\"\"&gt;\n\t\t\t\t&lt;label&gt;Nome&lt;\/label&gt;\n\t\t\t&lt;\/span&gt;\n\t\t\t&lt;span&gt;\n\t\t\t\t&lt;input id=\"element_2_2\" name=\"element_2_2\" class=\"element text\" maxlength=\"255\" size=\"14\" value=\"\"&gt;\n\t\t\t\t&lt;label&gt;Cognome&lt;\/label&gt;\n\t\t\t&lt;\/span&gt;\n\t\t&lt;\/li&gt;\n\t\t&lt;li id=\"li_3\"&gt;\n\t\t\t&lt;label class=\"description\" for=\"element_3\"&gt;Privacy &lt;\/label&gt;\n\t\t\t&lt;span&gt;\n\t\t\t\t&lt;input id=\"element_3_1\" name=\"element_3_1\" class=\"element checkbox\" type=\"checkbox\" value=\"1\"&gt;\n\t\t\t\t&lt;label class=\"choice\" for=\"element_3_1\"&gt;Iscrizione newsletter&lt;\/label&gt;\n\t\t\t\t&lt;input id=\"element_3_2\" name=\"element_3_2\" class=\"element checkbox\" type=\"checkbox\" value=\"1\"&gt;\n\t\t\t\t&lt;label class=\"choice\" for=\"element_3_2\"&gt;Comunicazioni commerciali&lt;\/label&gt;\n\n\t\t\t&lt;\/span&gt;\n\t\t&lt;\/li&gt;\n\t\t&lt;li class=\"buttons\"&gt;\n\t\t\t&lt;input id=\"saveForm\" class=\"button_text\" type=\"button\" name=\"submit\" value=\"Submit\" onclick=\"sendToBlendee();\"&gt;\n\t\t&lt;\/li&gt;\n\t&lt;\/ul&gt;\n&lt;\/form&gt;<\/code><\/pre>\n\n<p>In order to send the data to Blendee, when the user clicks on the button (remember that the tag must be <button> and not <submit>), we must enter the appropriate tracking code, which, in our case, is as follows:<\/submit><\/button><\/p>\n\n<pre class=\"wp-block-code\"><code>function sendToBlendee() {\n\tvar formEmail = $('#element_1').val();\n\tvar formContactName = $('#element_2_1').val();\n\tvar formContactSurname = $('#element_2_2').val();\n\tvar formNewsletterFlag = \"false\";\n\tvar formCommercialComunicationFlag = \"false\";\n\tvar formListeNewsletter = \"\";\n\tvar formDoubleOptIn = false;\n\t\n\tif ($('input&#91;name=\"element_3_1\"]:checked').length &gt; 0) {\n\t\tformNewsletterFlag = \"true\";\n\t}\n\t\n\tif ($('input&#91;name=\"element_3_2\"]:checked').length &gt; 0) {\n\t\tformNewsletterFlag = \"true\";\n\t}\n\n\t_sbnaq.push(&#91;\"trkNewsletterSubscription\", formEmail, formContactName, formContactSurname, formNewsletterFlag, formCommercialComunicationFlag, formListeNewsletter, formDoubleOptIn, function() {\n\t\t$('#form_25517').submit();\n\t}]);\n}<\/code><\/pre>\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>N.B. We remind you that the tracking of the user registration takes place automatically if the Blendee form made available in the Website -&gt; Form section is used<\/p>\n<\/blockquote>\n<div class=\"wrap-post-useful post_useful_13686\">\n<p><div style=\"color: black; margin-bottom: 15px;\"><strong>Was this content useful?<\/strong><\/div><\/p>\n<p class=\"post_useful_success post_useful_success_13686\">Thanks for contributing!<\/p>\n<div class=\"post-useful-buttons post_useful_buttons_13686\">\n<a href=\"javascript:;\" style=\"border:0px;\" title=\"Yes\" class=\"post-useful-vote post-useful-vote-yes\" data-id=\"13686\" data-rate=\"1\">Yes<\/a>\n<a href=\"javascript:;\" style=\"border:0px;\" title=\"No\" class=\"post-useful-vote post-useful-vote-no\" data-id=\"13686\" data-rate=\"0\">No<\/a>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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: To activate the subscription option, simply enter [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"template":"","format":"standard","article-category":[564],"article-tag":[],"class_list":["post-13686","article","type-article","status-publish","format-standard","hentry","article-category-e-mail-marketing"],"_links":{"self":[{"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/article\/13686"}],"collection":[{"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/types\/article"}],"author":[{"embeddable":true,"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/article\/13686\/revisions"}],"predecessor-version":[{"id":13688,"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/article\/13686\/revisions\/13688"}],"wp:attachment":[{"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/media?parent=13686"}],"wp:term":[{"taxonomy":"article-category","embeddable":true,"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/article-category?post=13686"},{"taxonomy":"article-tag","embeddable":true,"href":"https:\/\/helpcenter.streamwise.it\/en\/wp-json\/wp\/v2\/article-tag?post=13686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}