Custom Events

In addition to recording traffic, 99Dev also supports recording Custom Events with highly flexible JSON data attached allowing you to track button clicks, form submission, or nearly anything really!

Usage

The recordEvent function requires only a name for the event but can optionally include JSON data as well.

ES Module
main.ts
// Include the analytics code
import { recordEvent } from "@99devco/analytics"

// Send a simple event to the server when something happens.
function handleButtonClick () {
  recordEvent("Clicked Button");
}

// Or include JSON data for more info or to differentiate events
function handleVideoPlayed () {
  recordEvent("Played Video", { video: "filename.mp4" })
}

Script Tag
index.html
<!-- Include the analytics script tag -->
<script src="https://cdn.99.dev/analytics.js" data-site-uuid="<your-site-id>" async></script>

<!-- Utilize the global 99Dev object -->
<script>
document.getElementById("SomeButton").addEventListener("click", function () {
  nndev.recordEvent("Clicked Button");
})
</script>

Cost / Pricing

Custom Events utilize the same pricing as Page Views and count against the same credit balance. You can record traffic and events for the same $1 per 7,000 combined page views and custom events.

Viewing Results

Just like with Page Traffic, Custom Events can be viewed in the Dashboard App. Read more here.

Details & Limitations

Batching

Custom Events utilizing batching to group events, so you may notice a brief delay in submission if you’re monitoring your network traffic in your browser’s developer tools.

JSON Data

Each Custom Event can support JSON data with up to 50 properties and a maximum size of 15Kb.