Paste this once (e.g. in your root layout), then call window.plytics.track(eventName, params) anywhere in the frontend to send events.
Read API key for this backend (used by this dashboard and for calling /v1/events* directly):
Any event_name works, not just view_item / add_to_wishlist / search. Only two fields are required - the SDK fills them in automatically:
event_name- any string you chooseuser_pseudo_id- the device id, always set by the SDK (see below)
Everything else you pass is stored as-is and becomes filterable/exportable later. Call it from anywhere in the frontend:
Resulting payload sent to POST /v1/events (envelope fields auto-filled by the SDK, your fields passed through untouched):
Events with an unrecognized name are still accepted and stored - they show up here with is_registered_event: false. To get the same strict field validation the 3 built-in events get, add the name to TRACKER_ENABLED_EVENTS in .env.
| Time | Event | User | Platform | Source | Summary |
|---|