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 name | Description |
id | integer your custom unique identifier, up to 255 characters |
string user’s email address, up to 255 characters | |
name | string user’s name, up to 255 characters |
datetime | string 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 name | Description | ||
id | string your custom unique identifier, up to 255 characters | ||
datetime | date event date, must be in yyyy-mm-dd format | ||
phone | date user’s phone, up to 255 characters | ||
deliveryaddress | string user’s delivery address, up to 255 characters | ||
total | float total price for products, 1.000 format | ||
discount | float discount price for products, 1.000 format | ||
items | Object[] an information about the product | ||
Variable name | Description | ||
id | integer product identifier, up to 255 characters | ||
name | string product name, up to 255 characters | ||
price | float product price, 1,000 format | ||
url | string url to product page, up to 255 characters | ||
category | string product category, up to 255 characters | ||
imgurl | string 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 name | Description |
name | string any custom name for the event or item you want to track, up to 255 characters |
url | string 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