Pre-Requisites

Before proceeding, ensure you:

1

Get your project ID

Sign up on Litlyx and create a new project.

Fire Your First Event with cURL

Curious to see how Litlyx works with events? Simply use the cURL command below to send a test event. Just replace project_id with your actual project ID in your terminal.

curl -X POST "https://broker.litlyx.com/event" \
  -H "Content-Type: application/json" \
  -d '{
    "pid": "project_id",
    "name": "testEvent1",
    "metadata": "{\"test\": \"something\"}",
    "website": "something",
    "userAgent": "something"
  }'

Minimal Setup

Ensure you already initialized the library in your entry point.

Add the following line of code, in each key function you would like to track.

Lit.event("click-on-buy");

Handle Metadata

Sometimes just an event name isn’t enough. If you want to add more control to your data, you can use the metadata field. Like this:

Lit.event("click-on-buy", metadata: {
    "product_id": "1",
    "customer_id": "customer_id_1",
    "price": 1999.99,
    "product_name": "Design Chair with a cute cat!"
});

HTML example code

<button onclick="Lit.event('click-on-buy')">Buy</button>

Function example code

myFunction () {
  // your existing code...
  Lit.event('my-function-name');
}

Ready to go!

Analyze all yours custom events on the cloud dashboard.

  • Understand how users interact with your custom events by creating Custom Funnels.
  • Analyze where your users come from and trigger an event with the User Flow.
  • Interact with events metadata with our Events Metadata Analyzer.