Custom events
Accylin can be used to track custom events that occur on your website. There are two ways to record custom events in Accylin, using data attributes or using JavaScript.
Using data attributes
To enable events, simply add a special data property to the element you want to track.
For example, you might have a button with the following code:
Add a data property with the following format:
So your button element would now look like this:
When the user clicks on this button, Accylin will record an event named Signup button
.
You can optionally pass along event_data with the data-accylin-event-* annotation.
The additional properties will result in { email: 'bob@aol.com', id: '123' }
being recorded with the an Event named Signup button
.
- Event data cannot be sent without an event name.
- All event data will be saved as a string using this method. If you want to save event data as numeric, dates, booleans, etc. use the JavaScript method below.
Using JavaScript
- You can record events manually using the
window.accylin
object. To accomplish the same thing as above:
In this case, Accylin will record an event named Signup button
.
- The
accylin.track()
method accepts also a 2nd optional argument of a JavaScript object with an arbitrary number offields
andtypes
.
View events
Once your events are recorded, they will be available on your website Events page.
View event properties
Your custom data can be accessed under the Properties tab on the Events page. This section will show you all the custom data properties you saved as well as a breakdown of all the values.
Support
Need help? Contact us at support@accylin.com or visit our help center.