Skip to content

Analytics

AI Summary

A short gist of this page, generated for you.

Powered by AI. Summaries can miss nuance — when in doubt, read the page.

Gameplay time, sessions and ad activity are tracked for you. Use these calls for events that are specific to your game.

#trackEvent(eventName, properties?)

Tracks a custom event with optional properties.

javascript
// Level start
FunOxSDK.trackEvent('level_started', { level: 3, difficulty: 'hard' });

// Item purchased
FunOxSDK.trackEvent('item_purchased', { item: 'sword', cost: 100, currency: 'coins' });

// Achievement
FunOxSDK.trackEvent('achievement_unlocked', { achievement: 'first_win' });

// Any other game action
FunOxSDK.trackEvent('boss_defeated', { boss: 'dragon', time_seconds: 45 });

#Event names

Names are cleaned up before they are sent:

  • converted to lowercase
  • anything other than letters, numbers and _ becomes _
  • cut to 50 characters

So 'Level Started!' is recorded as level_started_. Use short snake_case names to avoid surprises.

An empty or non-string name is rejected with INVALID_EVENT.

#trackMilestone(name, value?)

A shortcut for milestone events.

javascript
FunOxSDK.trackMilestone('level_10_reached');
FunOxSDK.trackMilestone('score_10000', 10000);
FunOxSDK.trackMilestone('first_purchase', 'sword');

#Good practice

  • Track decisions and progress, not every frame or every tap.
  • Keep property values small — numbers and short strings.
  • Never put personal information in an event.