Articles on: My Contacts

How can I push user events?

If you are using Crisp on a website where users are authenticated, you may want to push events to retarget them later on different channels. Using Crisp, you can push events in two different ways: through the JS SDK and through the chatbot

This method uses the Crisp JavaScript API, that you can call from your own code or you can use the chatbot to trigger an event.

You can push an event from your backend too using our API, here is an article that explains everything about it.

Here's how you would proceed to push an event using the JS SDK:

// Feed this call with your own events data.
$crisp.push(["set", "session:event", [[
    ["product_bought", { price: "$200", name: "iPhone 6S" }, "red"]
]]]);


Sets one or multiple session events, with a text and an optional data object and optional color (in red, orange, yellow, green, blue, purple, pink, brown, grey, black)`

Of course, you need to replace product_bought with your own event name, own data and own color. For instance, you can use login or signup, upgrade, etc.

⚠️ Want to know more about the $crisp interface? Read: How to use $crisp Javascript SDK?

Here's how you would proceed to push an event using the chatbot:

So the chatbot offers different blocks that have specific behaviors. One of them makes you able to push an event to trigger a campaign. The one we're looking for is the "Push session event" block, which is an action block.

Push session event block

Use cases for pushing an event through the bot:

Automate email sequences following a product info request
Send a calendly link based on information granted through the bot
Push helpdesk articles from customers' input

Events are used for automation purpose, and must not serve as a permanent database of data. We only retain the most recent events for your users. If you need to store per-user data permanently, please use custom user data instead.

Updated on: 13/06/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!