trackSessionImpression method

Future<bool> trackSessionImpression(
  1. String impressionKey
)

Track impression: max 1 per banner per session (app open→close). Persisted across sessions. Returns true if counted (first view this session), false if already impressed this session.

Implementation

Future<bool> trackSessionImpression(String impressionKey) async {
  if (impressionKey.isEmpty) return false;
  if (_sessionImpressed.contains(impressionKey)) return false;

  _sessionImpressed.add(impressionKey);
  await _ensureLoaded();
  _counts[impressionKey] = (_counts[impressionKey] ?? 0) + 1;
  await _persist();
  return true;
}