Browse documentation

Introduction

From nothing to a first attributed event.

What Measura does

Measura matches an install back to the click that caused it, and stores the reasoning: which signal matched, how strong it was, and which candidates it rejected. Other tools return the verdict alone. Here you can audit a number you do not believe.

SignalHow it matchesBase confidence
install_referrerClick id carried through the Play Store install98
meta_referrerA Facebook or Instagram ad click, read from the same Play record with your Meta key98
click_idClick id read from a deep link the SDK opened95
ad_idAdvertising id matched exactly70
fingerprintDevice signals score above 0.85 similarity against a same-context reportup to 55
organicNo signal matchedn/a

Tried in that order, first match wins. A deterministic answer is never replaced by an inferred one.

Install the SDK

app/build.gradlegradle
dependencies {
    implementation 'dev.measura:measura-sdk:0.1.2'
}

Archive under 110 KB gzipped, held there by a build gate. Budget about 312 KB of APK growth in a minified release build, mostly WorkManager and Room. Permissions come through manifest merging.

Opt-out setup: no advertising ID

For an app that must not collect it, for example an app for children, do both of these. Use this init in place of the one in the next section.

Application.onCreatekotlin
Measura.init(this, "msr_...", MeasuraConfig(collectAdvertisingId = false))
AndroidManifest.xmlxml
<uses-permission
    android:name="com.google.android.gms.permission.AD_ID"
    tools:node="remove" />

Send your first event

Create an account to get an API key: msr_ followed by 64 characters, shown once.

MyApplication.ktkotlin
package com.example.app

import android.app.Application
import dev.measura.sdk.Measura
import dev.measura.sdk.core.EventType

class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Measura.init(this, "msr_your_key_here")
        // This SDK version waits for Wi-Fi by default (wifiOnlyMode = true):
        // on mobile data, events stay queued until Wi-Fi. To test on mobile
        // data, pass a config with wifiOnlyMode = false, or set Upload on to
        // Any connection under Integrations > SDK.
    }
}

// Then anywhere in your app:
Measura.trackEvent(
    EventType.PURCHASE,
    mapOf("revenue" to 49.99, "currency" to "USD")
)

Replace com.example.app with your app's Kotlin package. Android also needs to start this class. Add this attribute to your existing <application> element inAndroidManifest.xml:

AndroidManifest.xmlxml
android:name=".MyApplication"

If your app already has an Application class, put theMeasura.init call in its onCreate instead, and point android:name to that class.

The install event and first session fire automatically. This setup collects the advertising ID; for the opt-out setup, see Install the SDK.

For consent, initialise normally and call Measura.disableTracking() until the user agrees. The decision takes effect at once, is saved on the device in the background and survives a restart, so events are dropped rather than queued.

Sending without the SDK

Any backend can post signed events directly. Each carries an HMAC-SHA256 signature over a canonical payload, so ingest needs no session. Rules: event ingestion.

How attribution resolves

Within seconds of an install, a worker searches the app’s attribution window for a click that could have caused it, walking the signals above in order until one matches.

  • Deterministic: an identifier on both sides. A click id through the Play Install Referrer, a Meta ad read from that same referrer, or an advertising id.
  • Probabilistic: device signals (model, Android version, screen size, user agent) scored for similarity against the click. 0.85 or higher counts. The base is the similarity times 55 (55 at a perfect match); a distinctive device can add up to 10, and time, a shared network and fraud can take points off. App version is not scored on its own, only as part of the user agent.
  • Organic: nothing matched. Recorded as a result, not left blank.

Clicks too close to the install

A real install needs the store page, a download and a first open, so it starts well after the click. A click less than 10 seconds before the install, or after it, cannot have caused it: it is the mark of click injection, where malware fires a fake click as an install begins. Such a click gets no credit. It stays in the install's log as a rejected candidate, with the measured seconds, and the install goes to the next candidate or to organic. The check uses Measura's own clock, not the phone's, so a phone with the wrong time cannot trigger it. That clock needs the install to report its own age (age_ms); an install sent without it skips this check. It is also not applied to Play Install Referrer matches, because the referrer is the store's own record of the link and an injected click cannot fake it.

Meta ads

A Facebook or Instagram app-install ad sends people straight to Google Play, so no Measura link is clicked. Play still carries the campaign, ad set and ad, encrypted with your Meta app's Install Referrer Decryption Key. Save that key under Integrations, Ad networks, Meta install referrer, and those installs are credited to the exact ad. Without it the log says a Meta referrer was present but could not be read, rather than calling the install organic without comment.

Confidence scores

Every attribution scores 0 to 100. It starts at the base for the signal that matched, then moves on device entropy, click-to-install delta, shared IP, and the fraud pre-screen.

Below 20 it is downgraded to organic. The evidence is kept either way.

The glass box log

Every attribution stores its method, signals, written reason, confidence breakdown, and the candidate clicks it rejected with a reason for each. When an install lands somewhere you did not expect, you see the click that won, the ones that lost, and why. Read it at resource=attribution_log.

Platform support

PlatformStatus
AndroidSupported. Play Install Referrer, deep links, offline queue.
Server to serverSupported. Post signed events from any backend.
iOSNo native SDK currently. Events can be sent server-to-server.

Platform coverage today

The native SDK is currently available for Android, and that is where SDK development is focused today: Android carries the strongest signal there is, the Play Install Referrer, which passes a click id through the store install so the match is deterministic. A focused SDK stays small and its offline path properly tested. For anything else, the ingest API accepts signed events from any backend.

Play Data safety answers

Google Play asks every app what it collects. The answers are yours to give, but they have to cover what the SDK does. This is that, read from the SDK source.

Play data typeWhat the SDK sendsWhen
Device or other IDsThe advertising ID.By default, unless the person has Limit Ad Tracking on or you set collectAdvertisingId = false.
Device or other IDsDevice model, Android version, screen size and user agent, which Measura turns into a matching fingerprint.Always. It is how an install with no click ID is matched.
Device or other IDsThe Firebase Cloud Messaging token, for uninstall detection.Only if you call setPushToken().
App activity: App interactionsThe install, the first session and each event you send, with the properties you attach.Install and first session always; the rest when you call trackEvent().
Financial info: Purchase historyThe revenue amount and currency.Only on purchase events you send.
Personal info: User IDsYour own user ID and any traits you attach.Only if you call identify().
App activity: App interactionsThe name of the app store that installed your app (for example com.android.vending), and on Android 11 and later the app that opened the installer (for example a browser).On the install event only, from the next SDK release.

The installer package is app metadata, not personal data. It is the name of a store or installer app, such as com.android.vending for Google Play, and it says where the app was installed from. It does not identify the person, and it is sent once, with the install. It is not a new kind of data: it sits with the install event that the App activity row above already covers. Confirm the answer against your own Play Console form.

Not collected: location. There is no GPS, no network location and no IP lookup; the country field is the region of the phone's language setting, so en_NG gives NG, and the IP address is cut to its network part (/24 for IPv4, /48 for IPv6) before anything stores it. Nor the Android ID, IMEI, phone number, contacts, messages, photos, files, calendar, health or browsing data. Event properties and identify() traits carry whatever you put in them, so keep names, emails and phone numbers out, or declare them too.

The other questions on the form

  • Encrypted in transit: yes. Every request goes over HTTPS and every batch is signed.
  • Shared: Measura processes the data on your behalf, as your service provider, which Play does not count as sharing. Postbacks are different. If you connect Meta, Google, TikTok or Snap, installs and events go to that network with the advertising ID, so declare Device or other IDs and App activity as shared for Advertising or marketing, plus Purchase history if you send revenue.
  • Purposes: Analytics, and Fraud prevention, security and compliance. Add Advertising or marketing if you use postbacks.
  • Optional for users: only if your app offers an opt-out that calls Measura.disableTracking(). The choice survives restarts, and events are dropped, not queued, while it is off.
  • Deletion: Measura erases a person on request, under Settings, then Compliance, in the dashboard, by advertising ID, Measura device ID or fingerprint. Events also expire with your plan's retention, 14 days on Free and up to 90 days on paid plans, removed by a daily job.

This describes the SDK, not your whole app. Other SDKs you ship add their own answers, and the form is yours to sign.

Where to go next

Was this page useful?