Skip to content

Analytics (tracker)

FRVR.tracker is the analytics pipeline. It fans events out to every configured provider (FRVR’s own backend, Meta Pixel, AppsFlyer adapters you’ve wired in, etc.), automatically attaching player ID, app version, channel, and locale to each event.

Track each tutorial step in order. Re‑reporting an earlier step is a no‑op.

FRVR.tracker.ftue(1, 'opened_inventory');
FRVR.tracker.ftue(2, 'crafted_first_item');

If your onboarding isn’t linear — e.g. separate funnels for shop and combat — use ftueUnordered with a numbering scheme:

FRVR.tracker.ftueUnordered(201, 'opened_shop');
FRVR.tracker.ftueUnordered(104, 'finished_match');
FRVR.tracker.levelStart('level_1');
// ... play
FRVR.tracker.levelEnd('level_1', { stars: 3, deaths: 0 });
FRVR.tracker.logEvent('bought_skin', { skin: 'red_hat', slot: 'head' });

With a numeric value (LTV, score, duration):

FRVR.tracker.logValuedEvent('session_length', 142.3, {});

Event names should be snake_case; fields should be flat where possible.

If every event needs the same extra fields — current level, build variant, etc. — register a function that returns them:

FRVR.tracker.addExtraFieldFunction(fields => {
  fields.current_level = game.currentLevel;
  fields.build_variant = BUILD_VARIANT;
});

Runs on every event; mutate fields in place.

Small counters stored on the device and included on future events:

FRVR.tracker.set('preferred_hand', 'left');
FRVR.tracker.inc('total_deaths');      // +1
FRVR.tracker.inc('coins_earned', 50);  // +50

Before the player’s consent status is known, up to 100 events are queued. Once consent resolves, the queue is either dispatched (if granted) or dropped (if denied). You don’t have to gate your own calls — just fire events normally.

FRVR.config.tracker = {
  appVersion: '1.2.3',
  appBuild:   '4567',
  analyticsProviders: {
    metapixel: { pixelId: 'YOUR_PIXEL_ID' },
    // …others configured per channel
  },
};
  • page_loading — at the start of init()
  • game_loaded — when bootstrap completes
  • device_info — after bootstrap, with GPU/CPU hints

You can suppress any of these on a per‑channel basis; talk to your FRVR contact if you need that.

Live analytics

loading SDK…
 
MethodPurpose
logEvent(name, fields)Fire a custom event.
logValuedEvent(name, value, fields)Event with a numeric value.
ftue(step, name, fields)Sequential onboarding step.
ftueUnordered(step, name, fields)Onboarding step in a non‑linear funnel.
levelStart(name, fields?)Level started.
levelEnd(name, fields?)Level finished.
set(name, value)Persistent key/value attached to events.
inc(name, by?)Increment a persistent counter.
addExtraFieldFunction(fn)Enrich every event with dynamic fields.
loaded()Emit game_loaded (the bootstrapper does this for you).