Probabilistic matching is a fallback attribution method that identifies which ad click led to an app install by analyzing device fingerprint data. It is primarily useful on iOS when clipboard matching fails.
When to Use
iOS fallback: When
getInstallReferrerIos()returnsnull(the clipboard was empty or didn't match).Cross-platform validation: To confirm attribution from another method.
Enhanced attribution: To get additional click metadata and confidence scoring.
How It Works
The SDK collects device information (manufacturer, model, OS name, OS version) using
react-native-device-infoif available.It sends this data along with your domain to the Smler probabilistic matching API:
POST https://smler.in/api/v2/track/probablisticThe API compares the device fingerprint against recent click records for that domain.
If a match is found, the API returns the matched short URL, a confidence score, and the original click details.
Prerequisites
For the best match accuracy, install react-native-device-info:
npm install react-native-device-infoIf react-native-device-info is not installed, the SDK will still call the API but will send "Unknown" for the device and OS fields. This reduces the likelihood of a successful match.
Basic Usage
import { HelperReferrer } from '@smler/deferred-link';
import type { ProbabilisticMatchResult } from '@smler/deferred-link';
const result: ProbabilisticMatchResult = await HelperReferrer.getProbabilisticMatch({
domain: 'go.yourdomain.com',
});
if (result.matched) {
console.log('Match found!');
console.log('Confidence score:', result.score);
console.log('Short code:', result.pathParams?.shortCode);
console.log('Domain:', result.pathParams?.domain);
console.log('Original URL:', result.originalUrl);
} else {
console.log('No probabilistic match found');
}With Click ID
If you have a clickId (e.g. from a referrer parameter or a tracking pixel), you can provide it for more precise matching:
const result = await HelperReferrer.getProbabilisticMatch({
domain: 'go.yourdomain.com',
clickId: 'abc123-click-id',
});ProbabilisticMatchResult Fields
Field | Type | Description |
|---|---|---|
|
| Whether a match was found |
|
| Confidence score between 0.0 and 1.0 |
|
| The attributes that contributed to the match |
|
| Details of the click event that was matched |
|
| Full short URL metadata object |
|
| The device fingerprint data that was sent |
|
| Domain from the matched short URL (if matched) |
|
| Original destination URL (if matched) |
|
| Short code, DLT header, and domain from the matched link |
|
| Error code if the request failed |
|
| Error message if the request failed |
pathParams (when matched)
Field | Type | Description |
|---|---|---|
|
| The short URL code |
|
| Campaign/category header |
|
| Domain of the short URL |
Interpreting the Confidence Score
The score field represents how confident the system is that the match is correct:
0.8 – 1.0: High confidence. Safe to use for attribution and navigation.
0.5 – 0.8: Medium confidence. Consider using for attribution but may want to validate.
Below 0.5: Low confidence. The match may be incorrect — use with caution.
A common threshold is 0.65:
if (result.matched && (result.score ?? 0) > 0.65) {
// High enough confidence to act on
navigateToScreen(result.pathParams?.shortCode);
}Full iOS Flow with Probabilistic Fallback
import { SmlerDeferredLink, HelperReferrer } from '@smler/deferred-link';
const DOMAIN = 'go.yourdomain.com';
async function handleIosAttribution() {
// Step 1: Try clipboard matching first
const clipboardResult = await SmlerDeferredLink.getInstallReferrerIos({
deepLinks: [DOMAIN, `https://${DOMAIN}`, `*.${DOMAIN}`],
});
if (clipboardResult) {
// Clipboard match — resolve and navigate
const data = await SmlerDeferredLink.resolveDeepLink(
clipboardResult.fullDeepLink,
{ triggerWebhook: true }
);
console.log('Clipboard attribution:', data.originalUrl);
return;
}
// Step 2: Clipboard failed — try probabilistic matching
const probabilistic = await HelperReferrer.getProbabilisticMatch({
domain: DOMAIN,
});
if (probabilistic.error) {
console.error('Probabilistic match failed:', probabilistic.message);
return;
}
if (probabilistic.matched && (probabilistic.score ?? 0) > 0.65) {
console.log('Probabilistic attribution:', {
score: probabilistic.score,
shortCode: probabilistic.pathParams?.shortCode,
originalUrl: probabilistic.originalUrl,
});
// Navigate based on probabilistic.pathParams
} else {
console.log('No attribution match found (organic install)');
}
}Error Handling
The method does not throw. If anything goes wrong, the error and message fields will be populated:
const result = await HelperReferrer.getProbabilisticMatch({
domain: 'go.yourdomain.com',
});
if (result.error) {
console.error('Error:', result.error, result.message);
// result.matched will be false
}Possible errors:
"Validation"— the domain parameter was empty"HTTP 4xx/5xx"— the API returned an error status"Exception"— a network or unexpected error occurred