How to Transfer Custom Variables During a Subscription to a Chatbot

SendPulse's Facebook Messenger integration allows you to transfer {{phone}} and {{email}} variables to a SendPulse account during a subscription to a Facebook chatbot.

Using this method, you can pass variables for Facebook chatbots. 

Due to Telegram's restrictions on the length of payload (information that can be transferred with a subscription), at the moment, additional variables are not transferred with a subscription. The solution to this issue is currently under development.

You can set up the transfer of variables with two methods.

Method 1

After adding the code of a Facebook chat widget, add the following code to the site:

<script type="text/javascript">
    window.oSpP = {
        phone: '+123123123',
        email: 'username@example.com'
    }
</script>

If customers subscribed to the chatbot and after that the {{phone}} and {{email}} variables were added for these customers. Their data will not be transferred to the SendPulse account.

Please note: if you added a method for passing additional variables for web push notification subscribers using window.oSpP, there may be conflicts with the widget for collecting additional variables for the chatbot, and widget may not work.

Method 2

Add additional input fields with the sp_push_custom_data class to the site:

<input type="hidden" name="email" class="sp_push_custom_data " value="username@example.com">
<input type="hidden" name="phone" class="sp_push_custom_data " value="+123123123">

Both methods are universal for sites on any CMS.

Rate this article about "How to Transfer Custom Variables During a Subscription to a Chatbot"

User Rating: 4 / 5 (6)

    Other useful articles

    Popular in Our Blog

    Try SendPulse today for free