Pre-Requisites
Before proceeding, ensure you:1
Have installed Next
Get started here
2
Get your workspace ID
Sign up on Litlyx Dashboard and create a new workspace.
1. Install
Choose your package manager & install the library.2. Import
Now import litlyx in yourentry-point
file. Normally in Next, you can add this in layout.tsx
.
javascript
Don’t forget to add
use client
over the imports3. Initialize
Next, initialize Litlyx library with your workspace in your entry-point file as follow:javascript
Page Visits
, Real-Time Users
, Referrers
, Bounce Rate
, Countries
, Unique Visitor Sessions
, OS
& Devices
.
4. Collect Custom Events
To customize your experience, add the following line in each function you desire. There is no limit to the number of events.javascript
metadata
field.
javascript
javascript
Events
tab with the Event Metadata Analyzer
.