Sometimes analyzing ordinary HTTP requests is not enough. To better understand your visitors' behaviour, you can use custom events sent from their browsers (via JavaScript).

Qpackt exposes an endpoint where an event can be posted. Each event is saved together with its payload and some more stats. Sending an event is as simple as calling the sendEvent function with some parameters:

<script src="/qpackt/event/send_event.js"></script>
<script lang="js">
    sendEvent(`EVENT_NAME_${some_variable}`, {variable: {x: 0}}, 0)
</script>

You need to provide three parameters to the sendEvent function:

Collected events will be visible in Analytics page in Qpackt's admin console. You will see a breakdown per version, with option to download events as CSV. The CSV file will contain: