@traqio/react-native 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/android/build.gradle +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -51,11 +51,52 @@ On iOS, declare Traqio as the SKAdNetwork postback endpoint in `Info.plist`:
|
|
|
51
51
|
Traqio.setUserId(user.id); // the same id you give RevenueCat (app_user_id)
|
|
52
52
|
Traqio.track("purchase", { value: 9.99, currency: "EUR", transactionId: purchase.transactionId });
|
|
53
53
|
|
|
54
|
+
// Product analytics — never billed, never sent to an ad network:
|
|
55
|
+
Traqio.capture("deck_built", { format: "standard" });
|
|
56
|
+
Traqio.identify(user.id, { plan: "pro" }, { signup_platform: "ios" }); // user id + user properties (2nd overwrites, 3rd only if unset)
|
|
57
|
+
Traqio.register({ app_flavor: "beta" }); // super-properties: added to every analytics event
|
|
58
|
+
|
|
54
59
|
Traqio.onDeepLink(({ deepLink }) => {
|
|
55
60
|
if (deepLink) navigateTo(deepLink); // direct opens and the deferred link of a fresh install
|
|
56
61
|
});
|
|
57
62
|
```
|
|
58
63
|
|
|
64
|
+
## Groups (B2B accounts)
|
|
65
|
+
|
|
66
|
+
If you sell to teams, tell Traqio which account the user works in, right after sign-in.
|
|
67
|
+
Every analytics event that follows carries it (`groups: { company: "acc_42" }`), so the
|
|
68
|
+
console's Analytics can count accounts instead of people: funnels and retention by
|
|
69
|
+
account, unique accounts, and the list of your accounts with their properties.
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
Traqio.group("company", account.id, { plan: "enterprise", seats: 40 }); // traits optional
|
|
73
|
+
Traqio.getGroups(); // { company: "acc_42" }
|
|
74
|
+
Traqio.resetGroups(); // an account switch; on sign-out, reset() clears them too
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The type is lowercase (`company`, `workspace`, `team`: a letter, then letters, digits or
|
|
78
|
+
`_`, 30 characters at most), 5 types at most; the key is your own account id, 1–256
|
|
79
|
+
characters — never an email. Traits follow the identify rules (a 4th argument fills only
|
|
80
|
+
what is unset). Groups are kept in storage across launches, and the same key again with no
|
|
81
|
+
traits sends nothing new. `forgetMe()` forgets them too; an invalid call is ignored.
|
|
82
|
+
|
|
83
|
+
## Alias, sign-out and experiments
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
Traqio.identify("u_123");
|
|
87
|
+
Traqio.alias("guest_8f2c"); // the guest id IS u_123: history and properties merged
|
|
88
|
+
Traqio.reset(); // on sign-out
|
|
89
|
+
Traqio.exposure("paywall_copy", "b"); // $exposure { experiment, variant }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`alias(previousId)` merges what THIS device sent under `previousId` (a guest id, an id
|
|
93
|
+
from before sign-up) into the current user — the current user's properties win; ignored
|
|
94
|
+
without a current user id. A backend (`@traqio/node`, secret key) merges everything.
|
|
95
|
+
`reset()` forgets the user id, the super-properties and the groups and ends the analytics
|
|
96
|
+
session; events already queued keep their user, and the device id is kept (it carries the
|
|
97
|
+
attribution). `exposure(experiment, variant, props?)` sends `$exposure`, what the console's
|
|
98
|
+
experiment analysis reads — your app assigns the variant itself.
|
|
99
|
+
|
|
59
100
|
## Deferred deep links (invites, referrals)
|
|
60
101
|
|
|
61
102
|
A link can carry a per-share value — `https://go.example.com/c/invite?deep_link_value=<token>`
|
package/android/build.gradle
CHANGED
|
@@ -6,7 +6,7 @@ apply plugin: 'kotlin-android'
|
|
|
6
6
|
apply plugin: 'maven-publish'
|
|
7
7
|
|
|
8
8
|
group = 'io.khufu.traqio'
|
|
9
|
-
version = '0.2.
|
|
9
|
+
version = '0.2.7'
|
|
10
10
|
|
|
11
11
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
12
12
|
apply from: expoModulesCorePlugin
|
|
@@ -28,7 +28,7 @@ android {
|
|
|
28
28
|
defaultConfig {
|
|
29
29
|
minSdk safeExtGet("minSdkVersion", 24)
|
|
30
30
|
versionCode 1
|
|
31
|
-
versionName "0.2.
|
|
31
|
+
versionName "0.2.7"
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
compileOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traqio/react-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Traqio SDK for React Native / Expo — deterministic install attribution (Play Install Referrer) + SKAN. No IDFA, no fingerprinting.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"README.md"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@traqio/core": "0.
|
|
47
|
+
"@traqio/core": "0.9.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@react-native-async-storage/async-storage": ">=1.21.0",
|