How to track user behaviour on a website

For tracking the user behaviour, you can use our events REST API, or you can use our Javascript SDK.

Whatever activity a user perform on your website is called an event. Examples for events are, a user visits a particular page, a user searched for something, a user added a product to cart, user submitted the contact form. Like this, anything can be an event.

An event consists of 2 parameters

1. event_action

2. event_object

event_action

The name of event. Example – searched, added_to_cart, purchased, visited

event_object

The metadata that you want to pass along with this event.

For example, for an event_action – added_to_cart, metadata can be

id – unique id of the product added

name – A human readable string for understanding. Ex. product name

How to capture events using Engagespot REST API

REST API integration is usually done on your server side script. For example, if you have a search.php page which handles a search function on your website, you can call the events API and pass the search string to the API. The API doc is available at http://engagespot.co/guides

Please note that for the event_object, id and name are mandatory. If you don’t have a specific value for id, you can just use the value of name for id as well. But make sure that, id do not contain spaces.

How to capture events using Engagespot JAVASCRIPT SDK

This method can be used if you want to call the API on front-end.

var object = {id:"123", name:"Sample Product"}

Engagespot.captureEvent(‘added_to_cart’, event_object, callback);


Did this help answer your question?

thumbs up
thumbs down

Thanks for the feedback! 🙏🏽


Help by drift