expo-tiktok-ads-events 0.1.2 → 0.1.3
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 +92 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,8 +10,60 @@ npm install expo-tiktok-ads-events
|
|
|
10
10
|
yarn add expo-tiktok-ads-events
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
### Peer Dependencies
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install expo-tracking-transparency
|
|
17
|
+
# or
|
|
18
|
+
yarn add expo-tracking-transparency
|
|
19
|
+
```
|
|
20
|
+
|
|
13
21
|
## Setup
|
|
14
22
|
|
|
23
|
+
### iOS Configuration
|
|
24
|
+
|
|
25
|
+
#### SKAdNetwork Configuration
|
|
26
|
+
|
|
27
|
+
Add the following to your `app.json` to enable proper attribution for TikTok Ads:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"expo": {
|
|
32
|
+
"ios": {
|
|
33
|
+
"infoPlist": {
|
|
34
|
+
"SKAdNetworkItems": [
|
|
35
|
+
{"SKAdNetworkIdentifier": "238da6jt44.skadnetwork"},
|
|
36
|
+
{"SKAdNetworkIdentifier": "22mmun2rn5.skadnetwork"},
|
|
37
|
+
// ... add all required SKAdNetwork IDs
|
|
38
|
+
// Full list available in the example app
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> **Note:** The complete list of 150+ SKAdNetwork IDs is available in the [example app.json](./example/app.json). These IDs are required for proper attribution of TikTok Ads campaigns.
|
|
47
|
+
|
|
48
|
+
#### Tracking Permission
|
|
49
|
+
|
|
50
|
+
Add to your `app.json`:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"expo": {
|
|
55
|
+
"plugins": [
|
|
56
|
+
[
|
|
57
|
+
"expo-tracking-transparency",
|
|
58
|
+
{
|
|
59
|
+
"userTrackingPermission": "This identifier will be used to deliver personalized ads to you."
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
15
67
|
### Initialization
|
|
16
68
|
|
|
17
69
|
```typescript
|
|
@@ -24,11 +76,13 @@ const { status } = await requestTrackingPermissionsAsync();
|
|
|
24
76
|
// Initialize SDK
|
|
25
77
|
await TiktokAdsEvents.initializeSdk(
|
|
26
78
|
'YOUR_ACCESS_TOKEN', // TikTok Ads Manager access token
|
|
27
|
-
'YOUR_APP_ID', // App ID
|
|
79
|
+
'YOUR_APP_ID', // App ID
|
|
28
80
|
'YOUR_TIKTOK_APP_ID' // TikTok App ID
|
|
29
81
|
);
|
|
30
82
|
```
|
|
31
83
|
|
|
84
|
+
> **Important:** Get your credentials from [TikTok Ads Manager](https://ads.tiktok.com/)
|
|
85
|
+
|
|
32
86
|
## Usage
|
|
33
87
|
|
|
34
88
|
### Standard Events
|
|
@@ -198,15 +252,20 @@ export default function App() {
|
|
|
198
252
|
|
|
199
253
|
### Common Properties
|
|
200
254
|
|
|
201
|
-
- `currency` - Currency code (e.g., "USD", "EUR")
|
|
255
|
+
- `currency` - Currency code (e.g., "USD", "EUR", "BRL")
|
|
202
256
|
- `value` - Monetary value
|
|
203
|
-
- `content_type` - Content type
|
|
204
|
-
- `content_id` - Content ID
|
|
257
|
+
- `content_type` - Content type (e.g., "product", "subscription")
|
|
258
|
+
- `content_id` - Content ID or SKU
|
|
205
259
|
- `content_name` - Content name
|
|
260
|
+
- `content_category` - Content category
|
|
206
261
|
- `quantity` - Quantity
|
|
207
262
|
- `description` - Description
|
|
208
263
|
- `query` - Search query
|
|
209
|
-
- `status` - Status
|
|
264
|
+
- `status` - Status (e.g., "success", "failed")
|
|
265
|
+
- `level` - Level achieved (for gaming apps)
|
|
266
|
+
- `score` - Score value
|
|
267
|
+
- `success` - Success flag (boolean as string: "true"/"false")
|
|
268
|
+
- `payment_method` - Payment method used
|
|
210
269
|
|
|
211
270
|
### TypeScript Types
|
|
212
271
|
|
|
@@ -244,12 +303,16 @@ The SDK is automatically configured with:
|
|
|
244
303
|
- ✅ Retention tracking enabled
|
|
245
304
|
- ✅ SKAdNetwork enabled (iOS)
|
|
246
305
|
- ✅ Debug mode enabled (development)
|
|
306
|
+
- ✅ Install tracking enabled
|
|
307
|
+
- ✅ Auto tracking disabled (manual control)
|
|
247
308
|
|
|
248
|
-
##
|
|
309
|
+
## Requirements
|
|
249
310
|
|
|
250
311
|
- iOS 15.1+
|
|
251
312
|
- Android (in development)
|
|
252
313
|
- Expo SDK 54+
|
|
314
|
+
- TikTok Business SDK
|
|
315
|
+
- expo-tracking-transparency (for iOS 14+)
|
|
253
316
|
|
|
254
317
|
## Troubleshooting
|
|
255
318
|
|
|
@@ -259,6 +322,8 @@ The SDK is automatically configured with:
|
|
|
259
322
|
2. Confirm credentials are correct
|
|
260
323
|
3. Use test mode to validate events
|
|
261
324
|
4. Wait up to 24 hours for production events to appear
|
|
325
|
+
5. Ensure SKAdNetwork IDs are properly configured
|
|
326
|
+
6. Check that the app is running on a real device (not simulator)
|
|
262
327
|
|
|
263
328
|
### Empty Anonymous ID
|
|
264
329
|
|
|
@@ -267,23 +332,31 @@ Anonymous ID is generated after successful initialization. Make sure to call `in
|
|
|
267
332
|
### Initialization Error
|
|
268
333
|
|
|
269
334
|
Check:
|
|
270
|
-
- Valid access token
|
|
271
|
-
- Correct app IDs
|
|
335
|
+
- Valid access token from TikTok Ads Manager
|
|
336
|
+
- Correct app IDs (both App ID and TikTok App ID)
|
|
272
337
|
- Internet connection
|
|
338
|
+
- TikTok Business SDK is properly installed via CocoaPods
|
|
339
|
+
|
|
340
|
+
### SKAdNetwork Attribution Issues
|
|
341
|
+
|
|
342
|
+
- Ensure all required SKAdNetwork IDs are added to `app.json`
|
|
343
|
+
- Run `npx expo prebuild` after adding SKAdNetwork configuration
|
|
344
|
+
- Test on a real device (attribution doesn't work on simulator)
|
|
273
345
|
|
|
274
346
|
## API Reference
|
|
275
347
|
|
|
276
348
|
### Methods
|
|
277
349
|
|
|
278
|
-
#### `initializeSdk(accessToken, appId, tiktokAppId)`
|
|
350
|
+
#### `initializeSdk(accessToken, appId, tiktokAppId, debugMode?)`
|
|
279
351
|
Initialize the TikTok Business SDK.
|
|
280
352
|
|
|
281
353
|
**Parameters:**
|
|
282
354
|
- `accessToken` (string): TikTok Ads Manager access token
|
|
283
355
|
- `appId` (string): Your app ID
|
|
284
356
|
- `tiktokAppId` (string): TikTok app ID
|
|
357
|
+
- `debugMode` (boolean): Enable debug mode (optional, default: true in development)
|
|
285
358
|
|
|
286
|
-
**Returns:** Promise<string>
|
|
359
|
+
**Returns:** Promise<string> - "initialization successful" or error message
|
|
287
360
|
|
|
288
361
|
#### `trackTTEvent(eventName, properties?)`
|
|
289
362
|
Track a standard TikTok event.
|
|
@@ -342,9 +415,16 @@ Bruno Verçosa - [Pixel Logic Apps](https://github.com/Pixel-Logic-Apps)
|
|
|
342
415
|
|
|
343
416
|
Contributions are welcome! Please open an issue or submit a pull request.
|
|
344
417
|
|
|
345
|
-
##
|
|
418
|
+
## Resources
|
|
346
419
|
|
|
420
|
+
### Official Documentation
|
|
347
421
|
- [TikTok for Business](https://business.tiktok.com/)
|
|
348
422
|
- [TikTok Ads Manager](https://ads.tiktok.com/)
|
|
423
|
+
- [TikTok Events Manager](https://ads.tiktok.com/events_manager/)
|
|
349
424
|
- [TikTok Events API](https://business-api.tiktok.com/portal/docs)
|
|
350
|
-
- [
|
|
425
|
+
- [TikTok Business SDK iOS](https://github.com/tiktok/tiktok-business-ios-sdk)
|
|
426
|
+
|
|
427
|
+
### Related
|
|
428
|
+
- [Expo Modules Documentation](https://docs.expo.dev/modules/)
|
|
429
|
+
- [SKAdNetwork Documentation](https://developer.apple.com/documentation/storekit/skadnetwork)
|
|
430
|
+
- [App Tracking Transparency](https://developer.apple.com/documentation/apptrackingtransparency)
|