Ads & Revenue Share
Closegram shows ads on eligible creator profiles and splits the ad revenue between the creator and the platform. Ads only run for creators in a per-user beta allowlist, so the feature can be rolled out gradually.
Revenue can be settled two ways: from a server-side estimate (CPM/click values you configure) or from a real Google Ad Manager report imported per creator. The creator's share is paid out as coins, reusing the existing wallet and cashout flow.
Each property has its own checkbox marking whether that specific piece is fully implemented and functional end to end (frontend + backend) — update these yourself as work lands; this page won't overwrite them.
- Profile ad slot on eligible profiles — renders AdSense or Google Ad Manager (GPT), or a house placeholder; reports impressions (viewability-gated) and clicks
- Per-user beta allowlist (
ads_enabledon the user) gating which profiles show ads and earn - Server-side revenue estimate — impressions never declare their own revenue; the server computes it from configurable CPM / click value
- Monthly settlement — aggregate events, apply the creator/platform split, and credit creators as coins over a minimum threshold (idempotent per period)
- Real-revenue import — settle from a Google Ad Manager report (per-creator
creatorkey-value) via CSV paste or a one-click GAM pull - Admin panel
/ads(super_admin) — settings, beta allowlist (username search), placements, revenue view, settlement, real-revenue import, and manual coin transfers - Manual coin transfers — credit/adjust coins for any user, or a creator's computed share (editable amount)
- Google Ad Manager Reporting API client wired (implemented this session: real REST calls via
googleapis'sGoogleAuth, no longer a stub — still needs realGAM_SERVICE_ACCOUNT_KEY/GAM_NETWORK_CODEcredentials to go live; see the technical reference for the Beta-API caveat) - Site-wide AdSense verification script — the loader Google's AdSense setup asks you to paste into every page's
<head>, wired into the app's root layout (independent of the beta allowlist / revenue-share pieces above)
How the split works
Ads run only on profiles whose owner is in the beta allowlist. When a visitor views such a profile, the ad slot renders and reports an impression (and a click, if any); self-views never earn. The server attributes an estimated revenue to the profile owner using the configured impression CPM and click value (all money is stored in micros — 1,000,000 = 1 currency unit — to avoid floating point).
At the end of a period (YYYY-MM), settlement aggregates each creator's revenue, computes creatorShare = floor(gross × creatorSharePercent / 100), converts it to coins with coinsPerCurrencyUnit, and — if it clears minCreditCoins — credits the creator as a coin reward. Already-credited creators are skipped, so re-running a period is safe.
To settle from real money instead of the estimate, import a Google Ad Manager report (see the technical reference): the real per-creator gross replaces the estimate in the ledger, and the same split/credit runs.
Compliance note
Sharing AdSense earnings directly with third parties is against AdSense policy. The two supported, compliant models are: (1) the creator fund — estimate revenue and pay creators in coins from the platform (works today, no external dependency), and (2) Google Ad Manager + MCM (Multiple Customer Management) — creators are onboarded as child publishers and Google attributes revenue per creator via the creator key-value, which the real-revenue import then settles.
See the technical reference for GraphQL schemas, source file links, per-field wiring status, and the full setup & operations guide (Google account, environment variables, running settlement).