AdMob Sync

Overview

99% match with bank payout

Implementation

  • Core sync logic: src/lib/server/admob-sync.ts
  • API endpoints: src/routes/api/sync/admob/

More details

Primary source: AdMob's Estimated earnings

  • Somewhat accurate - 95% match with bank payout
    • but with the 4% correction factor we're using we get 99% match with bank payout in a year scale
    • in a month scale the accuracy is between 93-100%
  • Available immediately (0 days delay)
  • Dates input for fetch: dates interval
  • When data becomes available, how many days may the source adjust them: 7days (Claude told me, conservative)

How sync works

<!-- The sync can be triggered any time. So it needs to be idempotent,
can handle situations when it's wasn't run for a long period of time,
and also don't do anything if already ran today.

The fetching function will write the data to DB, and immediately update
the lastSyncDate if got higher value. So if it sucessfuly saved data for 12 december, and 
the lastSyncDate is currently 8 december it would udpate it to 12 december.

Note the date ranges are always inclusive. -->


if ( lastSyncDate < today ):
  fetchData ( range: {start: (lastSyncDate + 1day) - 7days, end: today} )
How the accuracy was measured + ground truth data for testing
  • admob's revenue - 1. Jul 2024 - 31. Dec 2025 (UTC)
    • arrived to bank account - 42107 €
    • reported by this finboard without correction factor - 44227.10 €
    • reported by this finboard with 4% correction factor - 42458.02 €