Buraq Help Center
ProductsBook a demo
  • 😃Welcome to Buraq
    • Buraq Basics
  • 🏁Getting Started
    • Building a Chatbot
    • Testing a Chatbot
    • Installation
      • Installation on Website
        • Installation using HTML
        • Installation using Google Tag Manager
      • Installing on Wordpress
      • Installing on SquareSpace
      • Installation on WhatsApp
      • Installation on Facebook
    • Deploying a Chatbot
    • Utility Tools
  • 🟦ACTION BLOCKS
    • Trigger
      • Set values to variables using Trigger
    • Send Message
    • Collect Input
    • Buttons
    • Carousel
    • Calendar
    • Send an Email
    • Condition
    • Image gallery
    • Talk to human
    • Slider
    • Collect file
    • Delay
    • Form
    • Flow
    • Jump
    • Codeblock
      • Dynamic Dialog Generator
    • Options
    • List
    • Reply buttons
    • AI model
    • Dynamic data
  • 🤖AI Studio
    • Overview
      • From URL
      • From File
      • From Intent
  • 🔌INTEGRATIONS
    • Overview
    • Events
    • HTTP request
    • Javascript
    • Zapier
    • Google Sheets
    • Salesforce
    • Codeblock
    • Airtable
    • Google Calendar
    • Calendly
    • HubSpot
    • Freshdesk
    • DialogFlow
    • Zoho CRM
    • Slack
      • Live Chat for Slack
      • Notification for Slack
    • ActiveCampaign
    • Link Tracking
  • 📲Whatsapp Business API
    • Overview
    • Cost
    • Limitations
    • Getting a WhatsApp API
      • From Meta
        • Creating a Facebook App
        • Adding the phone number
        • Generating permanent token
        • Configuring the webhook on Buraq
  • 💬Live Chat
    • Overview
      • Live Chat Screen
      • Live Chat Settings
  • ⚒️Troubleshooting
    • Cloning Bots
    • Connecting Action Blocks
    • Creating Loops
    • Setting up Fallback Variables
    • Setting up Link Tracking
    • Variable Manager
    • Image Dimensions
    • Tracking Facebook Pixel
    • Firing events on Google Analytics
  • ⛔Outbound Bots
    • Overview
    • Building One Off Campaign
    • Building Ongoing Campaign
    • Creating a WhatsApp Template
    • Action Blocks_ Outbound
      • Send WhatsApp
      • Send SMS
      • Delay
      • Branch
  • 🦾CHATBOT CUSTOMIZATION
    • Chatbot Appearance
    • Custom CSS
    • Embed chatbots on website
    • JS functions to show_hide
  • 🕵️‍♂️Account Management
    • Teams
    • Teammates
    • Purchasing a plan
    • Payment Methods
    • Refund Policy
    • Reset Password
    • Deleting Account
  • 📊Reporting
    • Analytics Dashboard
      • Chatbot Analytics
      • Agent Analytics
    • What are contacts in Buraq?
      • Scheduling a Contact Report
      • Exporting a Contact List
Powered by GitBook
On this page
  • Via Query Params
  • Injecting JSON in the code snippet
  1. ACTION BLOCKS
  2. Trigger

Set values to variables using Trigger

Want to personalise the chat or capture the details about the visitor even before the chat is initiated? This is now possible with Buraq by injecting custom variables using Trigger Block

PreviousTriggerNextSend Message

Last updated 1 year ago

Want to personalize chat or capture details about the visitor even before the chat is initiated? This is possible with Buraq where it allows you to inject custom variables from outside using the Trigger action block even before the chat is initiated.

The values can be anything like sending and storing the details like name of the visitor, utm parameters of where the visitor is coming from can be captured and mapped with the variables.

The values stored in these defined variables, and can later be used at any given point of time in the flow of the chat.

There are two methods in Buraq that a user can follow to parse the information into variables. They are:

Via Query Params

Using this method, you will be able to send Query Params on the domain in which the bot is hosted & you will be able to map those params in the ‘Trigger’ action block with a variable name.

For example,

Let’s say I want to store the value of utm_source and utm_medium, I can simply map these names in the 'Object path/parameter' column.

And choose the variables in which this value is to be stored.

You can add a maximum of 15 entries

Storing values for a WhatsApp chatbot

While using this section for a WhatsApp chatbot, you can store the payload received from the WhatsApp Business API provider.

This is helpful if you want to branch out the conversation flow based on button/text inputs from an outbound message sent.

Provider
Button input
Text input

Meta

360Dialog

messages[0].button.text

messages[0].text.body

360Dialog Cloud

Twilio

payload.Body

payload.Body

GupShup

Injecting JSON in the code snippet

Using this method the user will be able to inject a JSON payload inside Buraq's code snippet. And using the trigger action block the user will be able to map the object path with a variable.

For example,

<script src="" data-session-payload='{"name": "Charles", "phone": "8164848686"}' defer></script>

In addition to the code snippet, we have added a data-session-payload section. Adding this section with a JSON payload allows Buraq's to read these values and store them in variables.

In the above example, we have passed the values of “name” and “phone”, so now to store these values, we will map these fields on the Trigger action block.

It is essential to dynamically add this data-session-payload on Buraq's code snippet before the code snippet is fired, because Buraq only reads this data once.

To read the data again, visitors would have to refresh the page and start conversing with the bot again.

🟦
entry[0].changes[0].value.messages[0].button.payload
entry[0].changes[0].value.messages[0].text.body
entry[0].changes[0].value.messages[0].button.text
entry[0].changes[0].value.messages[0].text.body
payload.payload.text
www.buraq.ai?utm_source=google&utm_medium=website