How to improve your Messenger bot for pizza ordering and delivery

For pizza restaurants that plan to run (or use already) the Pizza Ordering and Delivery Messenger Bot and ready to get more from it, we updated the template and added even more useful features. Ordering pizza for customers has never been so easy!

Eugene Smirnov
Botmakers blog
6 min readOct 16, 2020

--

How to set this all up.

1. Get the template on your dashboard and install it to your ManyChat. The Botsheets app will be installed automatically alongside with the template.

2. Once the template is installed, get this Google Sheets template and make a copy of it.

3. Click the ‘Share’ button at the top right and change the settings in Google Sheets so that ‘Anyone with the link can view’. Copy the shareable link and paste it somewhere for now so you can access it.

4. Go to your ManyChat Settings/Growth Tools/Authorized Websites and add webview.botsheets.com to the list.

5. Go to ManyChat Settings/API/Get API Key and generate your key. Copy your API key.

6. Go to ManyChat Settings/Apps/Installed Apps, add the link to your Google Sheets template, your Botsheets key and your ManyChat API key.

7. Go to ManyChat Settings/Custom Fields/Bot Fields, add your Botsheets key and the link to your Google Sheets template. We’ll add a Webview_Token link a bit later.

7. Go to ManyChat Automation/Flows, find the flows under the number 3 - ‘Vegetarian pizza’ and ‘Non-Vegetarian pizza’, click ‘Edit’ the flows and make sure the Botsheets app generates a gallery from your Google Sheet data. Save actions and make the flows published.

Test out the bot from scratch and you will see the galleries with Vegetarian and Non-Vegetarian pizzas generate automatically from your Google Sheets template:

Now is the time to customize your Google Sheets template and adapt menu items for your pizza restaurant.

  • Column ‘active’ is responsible to make a current item active or not active
  • Column ‘title’ is an item of your menu in a ManyChat gallery
  • Column ‘subtitle’ is an item description
  • Column ‘image’ is a picture of an appropriate item

This is how it looks in your bot:

  • Columns ‘addButton1’, ‘addButton2’, ‘addButton3’ connect 3 buttons to each card of the gallery
  • Columns ‘button1Caption’, ‘button2Caption’, ‘button3Caption’ display button titles
  • Columns ‘button1Target’, ‘button2Target’, ‘button3Target’ link to a specific ManyChat flow. In our case, it will be the flow #4 - ‘Pizza customization’.

You can get the flow ID in your Manychat dashboard by navigating to the specific flow and then viewing the URL.

Copy everything after the files/ and paste it to your ‘button1Target’, ‘button2Target’, ‘button3Target’ columns:

  • Columns ‘button1Action’, ‘button2Action’, ‘button3Action’ set up custom field values. DO NOT DELETE or CHANGE THEM - these will save values for ‘button1ActionName’, ‘button2ActionName’, ‘button3ActionName’ custom fields.
  • Columns ‘button1ActionName’, ‘button2ActionName’, ‘button3ActionName’ set the values for custom fields Pizza, Pizza price, Pizza size when clicking on the appropriate button in the gallery.
  • Columns ‘button1ActionValue’, ‘button2ActionValue’, ‘button3ActionValue’ are the actual values for these custom fields.

💡 Example: When clicking on Pepperoni mid-size pizza for $15.99, the button2ActionValue’ - Pepperoni, mid-size, 15.99 will set up values for Pizza, Pizza size, Pizza price custom fields for the ‘button2ActionName’ column and send data back to the ManyChat.

You can get more information on how Botsheets works here.

❗ Please note, if you rename sheets, you will need to change the Google Worksheet Name in the Botsheets Action.

The next part is to add the ability to customize your pizza (or anything else) with the help of webviews.

1. Login with your Google account on https://app.botsheets.com. Go to: Webview Builder/Create a Webview Token/Add New

2. When your Webview Token is generated, click the icon to copy it to your clipboard, get back to your ManyChat Settings/Custom Fields/Bot Fields and paste the token into the Bot Field Value:

2. Create a Webview Configuration and name it ‘Pizza toppings’.

When you create a Webview Configuration, you need to make sure that your Webview Configuration name in the Botsheets dashboard matches with a configuration name in your Google Sheet template/’Toppings’ sheet.

If you’d like to change the Configuration Name, make sure you changed correctly it on your Botsheets dashboard and your Google Sheets template.

3. You’ll need to group selections with a heading. For each column under the heading, you would reference a Header Column Name. When customers make selections choose a specific Custom User Field to save that data. You can also choose how the data will be saved.

  • ‘Column Header Name’ must be exactly like the header in the ‘Toppings’ sheet (i.e. Topping and Price).
  • ‘Save to ManyChat User Field’ must contain the exact custom fields (i.e. topping and topping_price).

Again… If you want to change any header in the worksheet, don’t forget to change the ‘Column Header Name’ as well.

At the bottom of the configuration screen, you can see the ‘Submit Button’ options. Under the ‘Button Target’ choose flow #5 - ‘Pizza quantity’ which starts right after a customer clicks ‘Done ✅’ at the bottom of the webview.

Save your configuration and test out the customization options!

Now let’s set up delivery options.

If you offer delivery for different locations, you can charge a different delivery price based on the location.

1. Create another Webview Configuration on your Botsheets dashboard and name it ‘Delivery area’.

2. Find a worksheet named ‘Delivery’, add your delivery locations in the ‘Location’ column and delivery prices in the ‘Price’ column. If you’d like to rename the worksheet, you will need to change the SheetName Value in the External Request, which you can find in flow #9 - ‘Pick-up/Delivery’:

If you did that, test the request to make sure you have the ‘200 OK’ response:

3. Set up a Webview Configuration like at the screenshot below:

4. At the bottom of the configuration screen, you will see the ‘Submit Button’ options. Under the ‘Button Target’ choose flow #10 - ‘Complete order’ and save your configuration.

Congratulations, you are all set!

--

--