How It Works
A self-hosted server is one Cloudflare Worker with one D1 database. It runs the same code as the hosted service, minus the features that need your Appeeky account.- Ingest. The SDK batches installs, sessions, screens and events and posts them with the app’s publishable key (
apk_pub_…). A publishable key can only write events for its own app. - Revenue. RevenueCat and Superwall send purchase events to the worker. The worker matches each one to the install whose user id you passed to
Appeeky.identify, so the sale gets the install’s source, campaign and link. - Smart links.
/l/<slug>records the click and sends the visitor to the right store.- When the click carries an ad click id (
ttclid,fbclid,gclid,gbraid,wbraid), the click keeps it, together with the visitor’s IP address and user agent. - On Android the click always reaches the install, through the Play install referrer.
- On iOS it only reaches the install when the app is already installed and opens through the link. The App Store passes nothing to a fresh install, and the server does not fingerprint devices.
- When the click carries an ad click id (
- Scheduled work. A cron runs every 15 minutes. It retries Apple Search Ads lookups and, once a day per app, checks for anomalies.
- Reading data. You can read your data in three ways: the worker’s dashboard at
/, the REST API under/v1/apps/:id/...with your admin token, or the Appeeky desktop app connected to the server.
Hosted vs. Self-Hosted
Features that need your connected ad accounts or your Appeeky workspace only run on the hosted service. A self-hosted server can still send its data to your own systems through the conversion webhook.
Requirements
- Node 20 or later
- A Cloudflare account. The Workers free plan is enough to start.
Deploy
1
Create the database
database_id that d1 create prints into apps/worker/wrangler.toml.2
Set secrets and deploy
https://appeeky-analytics.<you>.workers.dev. To use your own domain, add it under Workers → Settings → Domains & Routes.3
Open the dashboard
Open
https://<worker>/ and sign in with your ADMIN_TOKEN. That browser keeps the token in local storage until you sign out.4
Add an app
publishableKey (apk_pub_…). For a Play Store app, use "platform": "google" and the package name as storeAppId.5
Point the SDK at your server
6
Connect RevenueCat
In RevenueCat, open Integrations → Webhooks and add a webhook:
- URL:
https://<worker>/v1/webhooks/revenuecat - Authorization header: your
REVENUECAT_WEBHOOK_SECRET - Environment: production
Appeeky.identify(await Purchases.getAppUserID()).Updating
To update, pull the new version and deploy again.npm run deploy applies any new D1 migrations before it deploys the worker, so the schema and the code stay in step.
App Settings
Change an app withPATCH /v1/apps/:id and your admin token:
POST /v1/apps/:id/rotate-key issues a new publishable key. DELETE /v1/apps/:id deletes the app and all of its data.
Superwall
If you sell through Superwall, instead of or alongside RevenueCat, send its events to the worker too.- Create a secret:
- In Superwall, add a webhook endpoint at
https://<worker>/v1/webhooks/superwalland send the secret as theAuthorizationheader. If you can’t set a header, put it in the URL instead:https://<worker>/v1/webhooks/superwall?secret=<SUPERWALL_WEBHOOK_SECRET>. - Pass the same user id to Superwall and to
Appeeky.identify, so purchases match their install.
Telegram Messages
The worker posts new sales (whennotifySales is on) and anomaly alerts to one Telegram chat.
- Create a bot with @BotFather and copy its token.
- Send the bot a message, or add it to a group or channel.
- Find the chat id: open
https://api.telegram.org/bot<token>/getUpdatesand readmessage.chat.id.
Anomaly Alerts
Once a day per app, after 01:00 in the app’s time zone, the cron compares the previous day with the median of the 14 days before it. It checks installs, revenue, trials and install-to-paid conversion.- When it alerts: the change is 50% or more, and the numbers are large enough to mean something.
- History needed: the app must have at least 7 days of history before it is checked.
- Frequency: each metric alerts at most once per day.
GET /v1/apps/:id/anomalies?range=30d lists them. See Anomaly alerts.
Conversion and Anomaly Webhook
To send revenue events to your own systems, for example to forward conversions to an ad platform yourself, set a webhook URL:429 and 5xx are retried up to three times, and ingest never waits for the webhook.
kind is one of trial_started, purchase, trial_converted, renewal or refund (with a negative valueUsd). Anomalies arrive as { "tenantId": "self", "type": "anomaly", "alert": { … } }, with the fields described in Anomaly alerts.
Smart Links for Ads and Posts
Create links withPOST /v1/apps/:id/links. Two optional fields say where a link is used:
channel:tiktok_ads,meta_ads,google_ads,apple_ads,tiktok,instagram,facebook,youtube,x,reddit,creator,web,emailorotherexternalId: the ad campaign id for ad channels, or the post URL or id for organic channels
GET /v1/apps/:id/links?range=30d) return clicks, installs and revenue per link. To keep the platform’s click id, use the smart link as the ad’s destination URL and let the platform append its click id parameter. See Smart links.
Users and Live Activity
See Users and live activity.
Use It From the Appeeky Desktop App
The desktop app can read a self-hosted server instead of the hosted service. Data goes straight from your server to the app, without passing through Appeeky.- Open an app’s Attribution tab and go to Setup → Data source.
- Choose My server, enter the worker URL and your
ADMIN_TOKEN, and select Connect. The app checks the server before it saves anything. The URL is stored on your Mac and the token in the macOS keychain. - If the server has no app for this store id yet, select Add to my server, or link an app that already exists on the server.
SKAdNetwork Postback Copies
iOS sends postback copies to the registrable domain named in the app’s Info.plist, at/.well-known/skadnetwork/report-attribution/ and /.well-known/appattribution/report-attribution/. iOS ignores subdomains, so use a domain you control at its root.
- Set the config plugin’s endpoint to your domain:
["@appeeky/analytics-expo", { "attributionEndpoint": "https://example.com" }]. - Serve those two paths from the worker on that domain, either with a Workers route (
example.com/.well-known/skadnetwork/*andexample.com/.well-known/appattribution/*) or with a rewrite on your site. Don’t redirect them, because iOS may not follow redirects. - Set the app’s
storeAppIdto its Apple ID.
Limits
Ingest is limited to 600 batches per minute per publishable key ([[ratelimits]] in wrangler.toml). When the SDK gets 429, it keeps the batch and retries.

