Once you've setup the tracking of users to be able to Create, Update, and Delete users, you'll be able to start tracking events for each user. This will enable you to take advantage of all the functionality within Cloudmattr.
Event Examples
See below for some examples on how you would setup some common events for your website or application. Event are completely customizable for your needs.
Link Click Event
Fires whenever a user clicks on a link.
<script src="https://cloudmattr.cloudmattr.com/packs/cloudmattr.js?v=1.0.0"></script>
<script type="text/javascript">
(function() {
Cloudmattr.init("pk_XXXxxXXxXxXXXxxxxXXxxxXx");
})();
Cloudmattr.event('link_click', {
user_id: '123456',
properties: {
'link_text': 'Dashboard',
'link_url': 'https://app.cloudmattr.com/'
}
});
</script>
Purchase Event
Fires whenever a user purchases a subscription.
<script src="https://cloudmattr.cloudmattr.com/packs/cloudmattr.js?v=1.0.0"></script>
<script type="text/javascript">
(function() {
Cloudmattr.init("pk_XXXxxXXxXxXXXxxxxXXxxxXx");
})();
Cloudmattr.event('purchase', {
user_id: '123456',
properties: {
"transaction_id": "O234235",
'amount': 80.00,
'items': [
{
'item_id': 'P12345',
'item_name': 'Ream of Paper',
'quantity': 2,
'amount': 10.00
},
{
'item_id': 'P67890',
'item_name': 'Printer',
'quantity': 1,
'amount': 60.00
}
]
}
});
</script>
Subscription Event
Fires whenever a user purchases a subscription.
<script src="https://cloudmattr.cloudmattr.com/packs/cloudmattr.js?v=1.0.0"></script>
<script type="text/javascript">
(function() {
Cloudmattr.init("pk_XXXxxXXxXxXXXxxxxXXxxxXx");
})();
Cloudmattr.event('subscription', {
user_id: '123456',
properties: {
'link_text': 'Dashboard',
'link_url': 'https://app.cloudmattr.com/'
}
});
</script>