How to Pass Custom Events and Display them in Activity Page

You can save subscriber data from various events on your website. Track meaningful actions to help your future marketing campaigns, such as when user’s login or register on your website, purchase something, click a certain button, etc.

Gathering this data helps you get a rich view of how users interact with your business and analyze user behavior for more personalized and effective communication with your audience. Then, you can filter and segment your users and send targeted messages.

Combine custom scenarios that display a widget for visitors after a specific behavior or action, and track your custom website events to create one coherent system.

What Data Can I Send?

To submit events you can use the chats13.event() javascript method. The data that you can transfer differs depending on the type of event: registration, login, order, purchase, update_cart, checkout, action.

Please note: to save data about your site visitors to 13Chats, your visitor needs to be your subscriber — i.e. they need to send a message to your live chat and start a conversation or subscribe to your Facebook chatbot. Data from a session will only be erased after a user clears their browser cache and cookies.

Registration and Login Events

Track each new registration to greet your newcomers or track when your existing clients login to give them a special offer later in the chat.

List of variables that you can transfer:

Variable nameDescription
idinteger
your custom unique identifier, up to 255 characters
emailstring
user’s email address, up to 255 characters
namestring
user’s name, up to 255 characters
datetimestring
event date, must be in yyyy-mm-dd format

Please note: Key names are case sensitive, write them exactly as they are displayed in the table. You can pass data to any variable listed in the table, but you cannot change its name or add other custom variables that are not in the above table. All variables are optional, none of them are required.

Sample code:

<script>
window.addEventListener('load', function() {
window.chats13.event({
    id: '112',
    email: 'qwe@gmail.com',
    name: 'name',
    datetime: '2020.01.01'
    },
  "registration");
</script>

Order, Purchase, UpdateCart and Checkout Events

Track the purchasing process in each stage of the deal to later ask a user for feedback or provide additional details about their order.

List of variables that you can transfer:

Variable nameDescription
idstring
your custom unique identifier, up to 255 characters
datetimedate
event date, must be in yyyy-mm-dd format
phonedate
user’s phone, up to 255 characters
deliveryaddressstring
user’s delivery address, up to 255 characters
totalfloat
total price for products, 1.000 format
discountfloat
discount price for products, 1.000 format
itemsObject[]
an information about the product
Variable nameDescription
idinteger
product identifier, up to 255 characters
namestring
product name, up to 255 characters
pricefloat
product price, 1,000 format
urlstring
url to product page, up to 255 characters
categorystring
product category, up to 255 characters
imgurlstring
url to product image, up to 255 characters

Please note: Key names are case sensitive, write them exactly as they are displayed in the table. You can pass data to any variable listed in the table, but you cannot change its name or add other custom variables that are not in the above table. All variables are optional, none of them are required

Sample code:

<script>
window.addEventListener('load', function() {
window.chats13.event({
    id: 1,
    datetime: 'YYYY-MM-DD',
    phone: '17895421358',
    deliveryAddress: 'Bristol',
    total: 299,
    discount: 0,
    items: [{
      id: 1,
      name: 'Сar seat Britax-Romer Discovery SL Strorm grey',
      price: 99,
      url: 'https://www.google.com/',
      category: 'Сar seat',
      imgUrl: 'url image'
    }, {
      id: 2,
      name: 'Сar seat 2  Britax-Lomer Discovery SL Strorm dark',
      price: 102,
      url: 'https://www.example.com/',
      category: 'Сar seat',
      imgUrl: 'url image'
    }]
  }, 'checkout');
</script>

Action event

Track any other custom actions on your website that help you better know your customers. Maybe you want to track clicks on a certain button, when a user opens a certain page, is shown a specific pop-up, etc.

List of variables that you can transfer:

Variable nameDescription
namestring
any custom name for the event or item you want to track, up to 255 characters
urlstring
url to any source, up to 255 characters

Please note: Key names are case sensitive, write them exactly as they are displayed in the table. You can pass data to any variable listed in the table, but you cannot change its name or add other custom variables that are not in the above table. All variables are optional, none of them are required.

Sample code:

<script>
window.addEventListener('load', function() {
window.chats13.event({
    name: 'someEventName'
    url: 'https://www.example.com/'
  }, 'action');
</script>

How to the Install Code

Copy and paste the code snippet inside your webpage’selement integrating it with your custom tracking script arguments.

In our samples the function is called on webpage loading, you can add any other custom functions.

Where Can I Check the Received Data?

Events that you send will be displayed in the Session page for each contact. To see information navigate to the Conversations tab, choose contact and click Activity.

Updated: 02.02.2022

1 Star2 Stars3 Stars4 Stars5 Stars
Loading...
Average Rating: 5/5
Total Votes: 1