作る

FunnableAnalytics

Minimal analytics client that reports gameplay milestones back to Funnable. Uses the Beacon API when available so telemetry is still delivered while a player closes or background the tab.

FunnableAnalytics

Minimal analytics client that reports gameplay milestones back to Funnable. Uses the Beacon API when available so telemetry is still delivered while a player closes or background the tab.

Examples

const sdk = Funnable.init();
sdk.analytics.trackPlay();
sdk.analytics.trackEvent("boss_defeated", { attempt: 3 });

Members

trackPlay

trackPlay(): void

Emits a "play" event that the platform uses for retention dashboards. Call this once after the player starts a session or launches a new level.

trackEvent

trackEvent(name: string, data?: Record<string, unknown>): void

Sends a custom analytics event with optional structured metadata.

Examples

sdk.analytics.trackEvent("power_up", { type: "shield", remaining: 12 });