Reference guide on how to track actions using Javascript
Funnelytics Event Script Schema:
<script>
window.funnelytics.events.trigger('Event Name', {
key0: ‘value’,
key1: ‘value’
})
</script>
Event Name(Required):
Can be any string, does not need to adhere to any strict naming convention. This is the Action Title that will appear in the Funnelytics Canvas
Properties(Optional):
Are organized into key and value pairs.
The key can be any string and does not need to adhere to any strict naming convention. However, if you wish to deanonymize users who have completed a form on your site, the key for the user’s name must be “name” and the key for the user’s email must be “email”
Values can be any string or number value and can be dynamically populated using variables.
Key and value pairs can also be assigned by passing a JavaScript object along with the event, however, Funnelytics will only accept a flat data structure and an object that contains nested values will fail
Event Script Examples
Generic Event
This is what a generic event with only an event name would look like. In this example the event name is scroll.
<script>
window.funnelytics.events.trigger("scroll")
</script>
You can include object properties to send additional properties to Funnelytics as well.
Here's another example of a scroll action with a property of the scroll % on the page.
<script>
window.funnelytics.events.trigger("scroll", {
depth: 25
})
</script>
Other Examples
These are just some quick examples, but you can add whatever values you want for the event name or object properties.
Button Click
This action could be used to track if a site visitor clicked a certain button.
<script>
window.funnelytics.events.trigger("click", {
button: "top cta",
page_path: "/optin"
})
</script>
Video View
This action could be used to track if the site visitor plays a certain video on your page.
<script>
window.funnelytics.events.trigger("video", {
video_title: "Sales Video",
video_action: "play"
})
</script>
Something missing?
if something is missing in the documentation or if you found some part confusing, please reach out to support team, with your suggestions for improvement.
We love hearing from you!