Datalumo
← Blog
View as Markdown

Announcement · Chat

Page actions for your chatbot

Page actions let your chatbot do something on the page: add a product to the cart, send someone to checkout, or open a page. And, you can implement your own actions.

Datalumo's chatbot could already answer questions from a knowledge base. Recently a feature was added where it could also undertake actions, like sending something to a webhook or doing a live web search.

Now, Datalumo has a new action called 'Act on the page'.

This is incredibly handy when you want the chatbot to do something on the page: add a product to the cart, or send someone to checkout.

What it is

The chatbot proposes something on the page when it's relevant, based on actions you configure. The visitor confirms it in the bubble. Then the site does the work.

The chatbot cannot magically add a product to your cart, but it dispatches a browser event you can listen to and act on.

For WordPress and WooCommerce, Datalumo comes with some powerful built-in actions. Those are add to cart, view cart, and go to checkout. It can also open a post or page. You pick those under Reply → Plugin actions.

These WordPress actions are available from plugin version 0.1.0.

If you want custom page action handling, see the docs. Here is a snippet:

window.addEventListener('datalumo:action', (event) => {
  const { name, widget, conversation_id, answer_id, tool_id, run, payload, respond } = event.detail;

  if (name !== 'add_to_cart') {
    return;
  }

  event.preventDefault();

  // code that adds the product to the cart

  respond({ ok: true, message: 'Added to your cart.' });
});

Confirm first

One thing that is annoying is when a chatbot does something you don't want it to. That's why with Datalumo, we always ask first.

And if something needs a choice first, the JavaScript SDK can ask the visitor. That is handy when a product has variants.

Try it

Open a chat widget → ReplyPlugin actions → WordPress.

Docs if you want the setup:

Chat actions

Jeffrey van Rossum
x.com/jeffreyrossum