#Analytics Logger
#Installation npm install logger-analytics-ch
#Usage Import the functions you need from the package:
-> import { logAnalytics } from "logger-analytics-ch";
#Log analytics data like this:
logAnalytics({ page_id: {service_id}, module_id: {service_perivlage_id}, user_id: {user_id}, channel_id: {channel_id}, session_id: {session_id}, }).then((result) => { if (result.status === "success") { console.log("Log sent successfully"); } else { console.warn("Log failed:", result.error); } });
#API Reference -> logAnalytics({ page_id, module_id, user_id, channel_id, session_id }) -> Logs analytics data to the remote server.
*page_id (required): number — The page identifier.
*module_id (required): number — The module identifier.
*user_id: number — User ID.
*channel_id: string — Channel ID.
*session_id: string — Session ID.
-> Returns a promise resolving to:
-
{ status: "success", data: ... } if logging succeeds.
-
{ status: "error", error: "Error message" } if it fails.