Litlyx
About this project
📚 Docs 👾 Join Discord 🌐 Website 🔥 Try Litlyx Cloud. It's Free forever.
Get Started on our Cloud Version
Sign-up on Litlyx.com and create a project. Then simply use your project_id
to connect Litlyx to your website.
Universal Installation
<script defer data-project="your_project_id" src="https://cdn.jsdelivr.net/gh/litlyx/litlyx-js/browser/litlyx.js"></script>
Importing Litlyx with a direct script instantly starts tracking Visits
, Top Pages
, Bouncing Rate
, Real-Time Online Users
, Unique Visitors
, Countries
, and Average Session Duration
.
All Javascript Runtimes
You can install Litlyx using npm
, pnpm
or any modern package managers:
npm i litlyx-js
Litlyx natively works with all JavaScript / TypeScript frameworks. You can use Litlyx in all WordPress Websites by injecting JS code using a third party plug-in.
Import using a package manager
First, Import litlyx-js library into your code:
import { Lit } from 'litlyx-js';
Once imported, you need to initialize Litlyx:
Lit.init('your_project_id');
After initialization, Litlyx will automatically track web analytics such as Page visits
, Real-Time Online Users
, Unique Vistors
, and many more.
Track Custom Events (Actions)
You aren't just limited to the built-in KPIs. With Litlyx, you can create your own events to track in your project.
Lit.event('click_on_buy_item');
If you want more specific tracking, you can use the metadata
field, like this:
Lit.event('click_on_buy_item', {
metadata: {
'product-name': 'Coca-Cola',
'price': 1.50,
'currency': 'EUR'
}
});
Litlyx makes it easy for you to tailor your analytics to your project's needs.
Fire Your First Event with cURL
Want to quickly see how Litlyx works with events? Use the cURL command below to send a test event. Just replace the 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"
}'
Self-hosting with docker
To self-host the Litlyx dashboard, first clone this repository. (Litlyx's Docke