Table of Contents

I was going through my facebook newsfeed today and saw a couple of giveaway contests which arose a question in my head; can I create a Facebook Contest with a Chatbot?

And luckily, the answer to my question is yes.

You can create a Facebook Contest Chatbot using Botsify and collect user responses faster than ever.

So let’s get started!

A Step-by-step Guide to Creating a Contest Chatbot

The below-mentioned chatbot flow can be created for your facebook as well as website chatbot but for this tutorial, I will be creating a Facebook contest chatbot.

In this guide, I will be explaining how to create a chatbot running Facebook Contest. You can add as many questions as you want, our chatbot will collect user answers for you.

Step 1: Log into your Botsify Account

First things first, make sure you are logged into your Botsify account through Facebook. Once you do, go to your Dashboard.

Step 2: Creating Entities (User Attributes)

If you are a Botsify user you must be wondering why I am choosing to create an ‘Entity’ first. Well, in order to make things smoother for you and avoid going back and forth while creating your main story I recommend creating an Entity at the beginning of creating your contest chatbot.

Here’s how you will create a user attribute for your main story:

→ In ‘Chatbot AI’ go to ‘Entities’ and click ‘Create an Entity’

→ Type your desired Entity Name, just like I did.

→ Then add Entity Values ‘True’ and ‘False’. Select ‘store as a user attribute’ and finally click add an entity to save it.

→ Now, make another Entity for the correct answer just like the one you created above and in entity values type ‘{last_user_msg}’ so that your chatbot can pick up what user has responded and compare it with the provided correct answer.

That’s it your Entity/User attributes have been saved

Wondering what you just did there?

User attributes will help you determine if a user has already played your contest or is playing for the first time and whether or not the answer is correct.

I will explain how in the next steps.

Step 3: Create the Correct Answer ‘Story’

In order to create your main story, that will initiate the conversation, you will need both the correct answers as well as the wrong answer stories for your chatbot.

Why?

Because when your Bot will be responding to the user’s message it needs to have the understanding of what has been just said. And to enable your chatbot to pick right and wrong answers you will have to create separate stories for both.

Here’s how:

→ Go to ‘story’ and select ‘Create story’.

→ Add user message and bot message. Bot message should contain the prize user has won.

→ Click save. Your story has been created.

Step 4: Create Incorrect Answer Story

If the user answers incorrectly, your bot must have a response to send. And for that, you will need to create another story by following the above-mentioned steps.

Step 5: Time to Create Your Main Story!

Now this story will be the conversation initiator. The entities and correct and incorrect stories that you previously created, will all be added to this main story of your Facebook contest chatbot.

→ Create a new story and add your desired keywords in the user message. For example, hello, I need help, I want to play the contest, etc.

→ Similarly, in the bot message write your desired message as a response to the user.

→ Now select another Bot message right underneath the first one and ask the user if they are interested to participate in the contest. For that, you will need to create quick replies.

→ Now create 2 quick replies, ‘Yes’ and ‘No’. This will help you differentiate between the users who are interested in playing the contest and the ones who are not.

→ Click on ‘No’ from your quick replies and type your bot response in case a user is not interested in playing your contest. This way your chatbot flow will end and your user won’t be bothered with unnecessary questions from your end.

→ Select ‘yes’ from your quick replies and add your question. This quick reply will determine your chatbot flow from here on.

→ Click on ‘Plugins’ underneath your bot response and select ‘Add User Attributes’ to add the Entityyou created earlier.

→ Now type in the entity name you created earlier and add value ‘true’. Once done click Add to save the entity.

Since the user has chosen to play, adding this entity here will store the answer in case the user tries to play again.

→ In the user message select message type ‘Type Anything’.

If you choose keyword or phrase or pattern message type, the bot won’t be able to differentiate between correct and incorrect answers. Instead, will only continue your flow if the user had responded correctly - or won’t respond at all if the answer is not what you have set up already.

So in order to tell the user whether the answer is correct or not you need to choose the option where they can send any message and bot will reply with either correct answer story or incorrect answer story.

→ Now create your answer Entity by repeating the same steps as above - type in the same entity name you created at the beginning and ‘{last_user_msg}’ in Entity Value.

→ Now add another plugin called ‘Typing indicator’. Set the timer as you like - I recommend no more than 6 to 8 seconds - this is just to add a little drama to your answer reveal (this step is optional and can be skipped).

→ Click on ‘Condtion’ option right next to Plugins.

→ Now is the time to use the correct and incorrect stories you created earlier.

→ Let's create the correct answer condition first.

→ Choose the story you created as a response to the user’s correct answer.

→ Choose the entity created for the correct answer under ‘Select Attribute’ dropdown.

→ Select ‘equals’ from the operator drop down.

→ And finally, type in the correct answer as the ‘Value’.

→ Click create and your 1st condition has been successfully created.

→ Click on the plus icon to create another condition for the incorrect answer.

→ Repeat the same procedure as above with a few changes - select your incorrect answer story and under the ‘Operator’ dropdown select ‘not equals’ instead.

This condition will help your bot differentiate between the correct and incorrect answer of your Facebook contest question. Once the bot gets the answer, it will then respond to your user with either of your predetermined response for correct and incorrect answers.

Your main story has been successfully created!

Step 6: User Attempting to Play Again Story

→ Type your desired ‘user message’.

→ In the bot response, write what you would want to say to users who have already participated in your contest.

→ Save your story and go back to your stories dashboard.

Step 7: Get Started Story (User Already Played)

The 5th and final story will be added to your ‘get started’ message and will determine if the user is eligible to participate or not.

How?

Your chatbot stores user attributes and won’t allow multiple attempts to your contest. Let's find out how.

→ Click create a story and choose any user message type and write any query you want.

→ Create a new condition here.

→ Choose the story you created in step 6 (as a response to users who have already played your contest) in ‘select story’ dropdown.

→ Select the entity you created at first (the one to differentiate if the user played contest or not) under ‘Entity’ dropdown.

→ Choose ‘equals’ as your operator from the dropdown.

→ And finally, add the value ‘True’ and click create.

→ Now select your ‘Fallback case’ and add your main story and save it.

Your fallback case works as the default condition here. Meaning, that a user will begin a conversation with your main story if he/she has not played the contest yet. And alternatively, the condition you created will send the response telling that multiple attempts cannot be made.

→ Save your story and that's it, you have successfully created all your stories, entities and conditions.

Step 8: Time for the Final Step

Now its time to integrate the last story you created to your ‘Get Started’ Message.

→ Simply got to basic messages, and click Get Started.

→ Choose Initiate a story from all the options given as your get started response and click save.

Tada! Your chatbot is ready.

Its time to put your chatbot to test, make sure to check if each and every scenario is working correctly. How the conversation begins, if the user responses are being responded to, if the winner is getting the prize and if the chatbot is keeping the track of who has played and who hasn’t.

Test Your Chatbot

→ Click on the test your bot icon at the bottom right corner of your dashboard.

→ Type in the user message you set up to check if the chatbot is responding.

→ Okay, now type no to see if the response is working.

→ The chatbot flow ended there. Now type your main story’s user message again and this time select yes from the options.

→ Type in the correct answer to check if the response is coming through.

→ Great, now try your bot again by typing your main story user message one more time and type the incorrect answer to check if it is working either way.

→ And finally, click on the side menu and select ‘delete conversation’ and start over to check if the user playing again story is working or not.

Fantastic! Your chatbot is ready to take your Facebook Contest all by itself. You can add as many questions as you want by following the steps mentioned. Just make sure to carefully implement each one.

Check out how to create a multi-language chatbot using Botsify here.

About the author

Areeba Khan

Areeba joined the Team as a Content Writer and works closely with the Development Team to stay on top of Botsify platform updates. Her core responsibilities include Writing and Developing Content of our Latest Features, Blogs, Ebooks and Social Media. She has Blogging/Content Writing expertise of more than 5 years - is an Arts Undergrad from University of Karachi.