Documentation
SDK version 0.3.0 for iOS and Android, 0.5.0 for the web.
Getting started
- Create an account and confirm your email.
- Under Apps & settings, create an app. You get a key like
pk_live_myapp_…. The key only lets an app send events; it can't read anything, so it's fine to ship it inside your app. - Add the SDK (below), call
configureonce when the app starts, and send events.
Every SDK sends session_start and app_open on its own, and engagement with the time spent in the
app (or with the page visible) each time it goes to the background, which the dashboard shows as session length. Apps on an SDK older than
0.3.0 (web 0.5.0) don't send it; for them session length is estimated from the first to the last event of each session. Events wait on the device while it's offline
and are sent in batches. Errors are swallowed: analytics never crashes or slows down your app.
Events from debug builds are marked and left out of the dashboard: see Testing your integration before your first run.
Testing your integration
When you run your app from Xcode or Android Studio, its events are marked as debug and the dashboard leaves them out, so tests never mix with real users. Under Apps & settings, open your app: the line at the top counts every event that arrived, debug ones included, and updates by itself while you wait for the first one.
| Platform | Counts as debug | Send as a normal build |
|---|---|---|
| iOS | Builds with the DEBUG flag (Xcode's Debug configuration) | var options = HoldMyIO.Options(); options.debug = false |
| Android | Debuggable builds (android:debuggable, every debug build type) | HoldMyIO.Options(debug = false) |
| Web | localhost, 127.0.0.1, *.local, *.test | data-debug="false" on the script tag |
The app SDKs send every 30 seconds or every 20 events, whichever comes first, and when the app goes to the background.
Call HoldMyIO.flush() to send right away. The web script sends within a moment and when the page is hidden.
Turn the debug override off again before you release, or your test runs will count as real users.
iOS
iOS 15 or later. In Xcode choose File, Add Package Dependencies, enter https://github.com/vaidotassackus/holdmyio-sdk
and pick version 0.3.0 or later (product HoldMyIO). Configure it once, as early as possible:
import HoldMyIO
// SwiftUI
@main struct MyApp: App {
init() {
HoldMyIO.configure(appKey: "pk_live_…", endpoint: URL(string: "https://holdmy.io")!)
}
var body: some Scene { WindowGroup { ContentView() } }
}
// UIKit: in application(_:didFinishLaunchingWithOptions:)
HoldMyIO.configure(appKey: "pk_live_…", endpoint: URL(string: "https://holdmy.io")!)
The endpoint is always https://holdmy.io; it is a parameter so the SDK has no address built in. Apps already released with https://io.holdmy.company keep working: that address still accepts events.
The SDK doesn't use the IDFA or any “required reason” API, and ships its own privacy manifest. In App Store Connect, declare Device ID, Product Interaction and, if you send purchases, Purchase History, all for Analytics and not linked to the user.
Android
minSdk 24, no dependencies of its own. The SDK comes from JitPack: add the repository in settings.gradle.kts
and the dependency in app/build.gradle.kts:
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://jitpack.io")
}
}
// app/build.gradle.kts
dependencies {
implementation("com.github.vaidotassackus:holdmyio-sdk:0.3.0")
}
Without JitPack: download holdmyio-android-0.3.0.aar into app/libs/ and use
implementation(files("libs/holdmyio-android-0.3.0.aar")) instead.
Configure it in your Application class. If your app doesn't have one yet, create it and register it in
AndroidManifest.xml with <application android:name=".MyApp" …>:
import android.app.Application
import com.holdmyio.HoldMyIO
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
HoldMyIO.configure(this, appKey = "pk_live_…", endpoint = "https://holdmy.io")
}
}
In the Play Console Data safety form, declare Device or other IDs, App interactions and, if you send purchases, Purchase history, for Analytics.
Websites
<script src="https://holdmy.io/sdk/holdmyio.js" data-key="pk_live_…" data-version="1.4.0" defer></script>
Page views are recorded automatically, including single-page app navigation (set data-spa="false" and call
HoldMyIO.page() yourself if you prefer). Other attributes on the script tag:
| Attribute | What it does |
|---|---|
data-version | Your site's version, for App versions and the release lines on the chart |
data-pageviews="false" | No automatic page views; call HoldMyIO.page("/path") yourself |
data-spa="false" | Don't follow history changes (pushState, back and forward) |
data-debug="true" or "false" | Mark events as debug, or not, whatever the host (see Testing) |
The script loads with defer, so window.HoldMyIO exists once the page has been parsed. Call it from your own
deferred script or module, or after the DOMContentLoaded event, and use window.HoldMyIO?.track(…) where it might
not be there (an ad blocker, for example). If your site has a Content Security Policy, allow
script-src https://holdmy.io and connect-src https://holdmy.io.
On the web there is no screen(), purchase() or setEnabled(): pages come from
page(), and consent(false) is the opt-out.
Without consent the script stores nothing in the browser: the server tells visitors apart only within a single day, by a one-way hash that uses a key replaced every day. Returning visitors and retention need consent:
HoldMyIO.consent(true) // keeps a random ID in localStorage HoldMyIO.consent(false) // removes it, back to anonymous counting
Without consent, the dashboard shows unique visitors per day: the same person counts again on another day, so those numbers are never added up across days, and retention is shown only for visitors who consented.
Paths with secrets in them
Query strings and # are never sent, but the path itself is. If some routes carry a secret, such as a password reset link
or an invitation, give the script a filter that replaces just those parts. It is applied to every path the script reads by itself,
including events sent before the first page view:
HoldMyIO.setPathFilter(function (path) {
return path
.replace(/^\/reset-password\/[^/]+/, "/reset-password/:token")
.replace(/^\/invite\/[^/]+/, "/invite/:token");
});
:token”
also hides article and product slugs, so every article ends up as one page like /learn/:token. Replace record numbers
with :id if you like, but keep readable slugs as they are.Languages and bots
The script sends the page's own language (<html lang>) as well as the browser's, so a multilingual site sees which
version people actually read. Search engines, SEO and AI crawlers and headless browsers send nothing; if one still gets through,
the server recognizes it by its User-Agent, stores its events apart, and the dashboard lists it under Bots left out without
counting it anywhere else. Only a rough browser family (Chrome, Safari, Googlebot) is kept, never the full User-Agent.
Events
// Swift
HoldMyIO.track("video_exported", props: ["mode": "montage", "clips": 8])
// Kotlin
HoldMyIO.track("video_exported", mapOf("mode" to "montage", "clips" to 8))
// JavaScript
HoldMyIO.track("signup", { plan: "pro" })
Names start with a letter and may contain letters, digits, _ and ., up to 64 characters
(for example video_exported or Video.exported; pick one style and keep it). An event with another name is
rejected by the server and not stored. Property values are text, numbers or booleans. Open any event in the dashboard
to see its trend, its properties and its numbers by app version.
These names are sent by the SDKs or the server, so don't use them for your own events: session_start, app_open,
screen_view, engagement, purchase, store_purchase, store_refund, store_identity.
Screens
// Swift and Kotlin
HoldMyIO.screen("editor")
// JavaScript: page views are screens
HoldMyIO.page("/editor")
Records a screen_view and remembers the screen, so later events know where they happened. The dashboard uses it for
Pages and screens, Screen flow, and funnel steps such as screen:editor.
Purchases
// Swift, iOS 16 or later: a verified StoreKit 2 transaction, price and currency taken from it
if case .success(.verified(let transaction)) = try await product.purchase() {
HoldMyIO.purchase(transaction)
await transaction.finish()
}
// Swift, any purchase (price is a Decimal)
HoldMyIO.purchase(productId: "pro_lifetime", price: Decimal(string: "19.99")!, currency: "EUR")
// Kotlin
HoldMyIO.purchase(productId = "pro_lifetime", price = 19.99, currency = "EUR")
Only the product, price and currency are sent. To also see refunds and renewals, connect RevenueCat: in Apps & settings open your app, create the webhook secret and add the URL in RevenueCat under Project settings, Integrations, Webhooks. Revenue is shown per currency, without conversion.
Opt-out and privacy
// Swift and Kotlin HoldMyIO.setEnabled(false) // nothing is collected, unsent events are deleted HoldMyIO.setEnabled(true) // JavaScript HoldMyIO.consent(false) // back to anonymous counting, the stored ID is removed
Give your users a switch for this and mention the analytics in your privacy policy. What Hold My IO stores and doesn't store is described in our privacy policy; you are the controller of your users' data and we process it for you.
Funnels
On the dashboard, under Funnels, choose New funnel and pick 2 to 8 steps from your events and screens, in order, plus how long people have to complete them (1 hour to 30 days). Each step shows how many people reached it and the share of the previous step. Funnels are saved per app; only owners can create or delete them.
Limits
| What | Limit |
|---|---|
| Requests per app | 600 per minute |
| Events per app | 300,000 per day (UTC) |
| Events per request | 100, body up to 256 KB |
| Properties per event | 32; keys up to 64 characters, values up to 256 |
| Event age | up to 30 days old (offline queues), at most 1 day in the future |
| Retention | events are kept for 25 months |
| Apps | 50 per organization |
| Invitations | valid for 7 days |
Above a limit the server answers 429 with Retry-After, and the SDKs keep the events and try again later.
HTTP API
The SDKs use one endpoint. You can call it directly from a server or another platform:
POST https://holdmy.io/v1/events
X-App-Key: pk_live_…
Content-Type: application/json
{
"context": { "install_id": "random-uuid", "platform": "ios", "app_version": "1.2.0",
"os_version": "26.1", "device_model": "iPhone17,1", "locale": "en_US",
"sdk_version": "custom", "debug": false },
"events": [ { "id": "event-uuid", "name": "video_exported", "ts": 1763650000000,
"session_id": "session-uuid", "screen": "editor", "props": { "mode": "montage" } } ]
}
Use a new UUID for every event: the server removes duplicates by id, so retrying is safe.
The answer is 202 with the number of accepted and rejected events. This contract only grows: fields are added, never changed or removed.
Read API
Read your app's statistics from a script, a spreadsheet or another tool. An owner creates a read key under Apps & settings (open the app, Read API keys). The key is shown once, can only read, and only that app.
curl -H "Authorization: Bearer rk_…" \
"https://holdmy.io/v1/query/summary?from=2026-11-01&to=2026-11-30" # dates of your choice, UTC
{ "app": "myapp", "query": "summary",
"rows": [ { "users": "1840", "sessions": "3900", "events": "52000", "screen_views": "21000" } ] }
GET /v1/query/ lists the available queries. The useful ones:
| Query | Parameters | Rows |
|---|---|---|
summary | from, to | users, sessions, events, screen views |
dau | from, to | per day: users, sessions, events, screen views |
top_events | from, to | event name, count, users |
event_trend | from, to, event | per day: count and users of one event |
event_props | from, to, event | property, value, count, users |
funnel | from, to, steps (JSON array), window (seconds) | users per step |
retention | from, to | cohort, new users, day 1, 7 and 30 |
revenue | from, to | per day and product: purchases, refunds, net |
versions, countries, devices, os_versions | from, to | users and events by each |
Dates are UTC, at most 400 days apart. Debug builds are left out. Numbers come back as strings so large counts keep their precision.
Up to 60 requests per minute per key; above that the answer is 429.
Troubleshooting
| What you see | What to check |
|---|---|
| “Waiting for the first event” never changes | The key is the one under Apps & settings and not revoked; configure runs at start;
the app has network access. On iOS, events go out after 30 seconds, after 20 events or when the app goes to the background: call HoldMyIO.flush() to test. |
| Events arrive, the dashboard is empty | They are debug events (the status line says how many). Run a release build or turn the debug override on, see Testing. |
| Some events are missing | The name breaks the naming rules, or opt-out (setEnabled(false)) is on for that device. |
| Web: nothing at all | An ad blocker, a Content Security Policy without holdmy.io, or HoldMyIO called before the script loaded. |
Answers with 429 | A limit was reached; the SDKs keep the events and send them later on their own. |