Track an app
Trace a signed-up user's journey — one call per action, no API key needed in the app itself.
For a real app — one with signup, not an anonymous landing page — trace the journey of a real, identified user instead of using the anonymous web tracker. One call per action: what happened, where it happened, and where it led — no separate identify step, no client- held state. The user id is just passed on every call, the same way your app already knows who's logged in.
#React Native
npm install @real-ana/react-nativeCreate the client once, at the app root, and reuse the same instance everywhere:
import { createRealAna } from "@real-ana/react-native";
export const analytics = createRealAna({
siteId: "YOUR_APP_SITE_ID",
apiUrl: "https://quantalog-be.daorbit.in",
});#Web app
No SDK needed — one plain function does the same thing from a browser:
async function trace(userId: string, action: string, src?: string, dest?: string) {
if (!userId) return;
await fetch("https://quantalog-be.daorbit.in/api/track", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
siteId: "YOUR_APP_SITE_ID",
appUserId: userId,
action,
src,
dest,
}),
}).catch(() => {});
}#A full journey
Two calls across two screens is the whole shape — call it right where the action happens:
// User taps into the dashboard from Home
<Button onPress={() => {
analytics.trace(user.id, "dashboard_opened", "home", "dashboard");
navigation.navigate("Dashboard");
}}>
Open dashboard
</Button>
// User taps "Add widget" on the Dashboard
<Button onPress={() => {
analytics.trace(user.id, "add_widget_clicked", "dashboard", "widget_modal");
openAddWidgetModal();
}}>
Add widget
</Button>That's exactly what shows up, in order, on that user's timeline in the dashboard — dashboard_opened, then add_widget_clicked — the same "which page, which step, which event fired" answer session replay tools give you, built from two calls you already had a reason to make.
#trace(userId, action, src?, dest?)
userId— required. Your own id for this user; nothing is recorded without it.action— required. What happened, named as a verb:add_to_cart,checkout_step_2,share_tapped.src/dest— optional. Where the action happened and where it led. Omit both for a one-off event that isn't really a step between two places.