@datalyr/react-native 1.5.0 → 1.6.1
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/CHANGELOG.md +39 -0
- package/README.md +82 -121
- package/android/build.gradle +0 -7
- package/android/src/main/java/com/datalyr/reactnative/DatalyrNativeModule.java +2 -380
- package/android/src/main/java/com/datalyr/reactnative/DatalyrPackage.java +1 -1
- package/datalyr-react-native.podspec +3 -7
- package/expo-module.config.json +4 -1
- package/ios/DatalyrNativeModule.swift +0 -266
- package/lib/datalyr-sdk.d.ts +14 -5
- package/lib/datalyr-sdk.js +90 -144
- package/lib/http-client.js +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/integrations/index.d.ts +3 -4
- package/lib/integrations/index.js +3 -4
- package/lib/native/DatalyrNativeBridge.d.ts +6 -22
- package/lib/native/DatalyrNativeBridge.js +6 -147
- package/lib/native/index.d.ts +1 -1
- package/lib/native/index.js +1 -1
- package/lib/types.d.ts +5 -19
- package/package.json +3 -5
- package/src/datalyr-sdk-expo.ts +96 -140
- package/src/datalyr-sdk.ts +102 -174
- package/src/http-client.ts +2 -2
- package/src/index.ts +1 -1
- package/src/integrations/index.ts +3 -4
- package/src/native/DatalyrNativeBridge.ts +6 -241
- package/src/native/index.ts +0 -2
- package/src/types.ts +11 -26
- package/src/utils-expo.ts +2 -2
- package/ios/DatalyrObjCExceptionCatcher.h +0 -14
- package/ios/DatalyrObjCExceptionCatcher.m +0 -30
- package/lib/integrations/meta-integration.d.ts +0 -77
- package/lib/integrations/meta-integration.js +0 -219
- package/lib/integrations/tiktok-integration.d.ts +0 -83
- package/lib/integrations/tiktok-integration.js +0 -360
- package/src/integrations/meta-integration.ts +0 -239
- package/src/integrations/tiktok-integration.ts +0 -363
package/lib/native/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Native Module Exports
|
|
3
3
|
*/
|
|
4
4
|
export { SKAdNetworkBridge } from './SKAdNetworkBridge';
|
|
5
|
-
export { isNativeModuleAvailable, getSDKAvailability,
|
|
5
|
+
export { isNativeModuleAvailable, getSDKAvailability, AdvertiserInfoBridge, } from './DatalyrNativeBridge';
|
package/lib/types.d.ts
CHANGED
|
@@ -5,24 +5,12 @@ export interface AutoEventConfig {
|
|
|
5
5
|
trackPerformance?: boolean;
|
|
6
6
|
sessionTimeoutMs?: number;
|
|
7
7
|
}
|
|
8
|
-
export interface MetaConfig {
|
|
9
|
-
appId: string;
|
|
10
|
-
clientToken?: string;
|
|
11
|
-
enableDeferredDeepLink?: boolean;
|
|
12
|
-
enableAppEvents?: boolean;
|
|
13
|
-
advertiserTrackingEnabled?: boolean;
|
|
14
|
-
}
|
|
15
|
-
export interface TikTokConfig {
|
|
16
|
-
appId: string;
|
|
17
|
-
tiktokAppId: string;
|
|
18
|
-
accessToken?: string;
|
|
19
|
-
enableAppEvents?: boolean;
|
|
20
|
-
}
|
|
21
8
|
export interface DeferredDeepLinkResult {
|
|
22
9
|
url?: string;
|
|
23
10
|
source?: string;
|
|
24
11
|
fbclid?: string;
|
|
25
12
|
ttclid?: string;
|
|
13
|
+
gclid?: string;
|
|
26
14
|
utmSource?: string;
|
|
27
15
|
utmMedium?: string;
|
|
28
16
|
utmCampaign?: string;
|
|
@@ -43,8 +31,6 @@ export interface DeferredDeepLinkResult {
|
|
|
43
31
|
* enableAutoEvents: true,
|
|
44
32
|
* enableAttribution: true,
|
|
45
33
|
* skadTemplate: 'ecommerce',
|
|
46
|
-
* meta: { appId: 'FB_APP_ID' },
|
|
47
|
-
* tiktok: { appId: 'APP_ID', tiktokAppId: 'TIKTOK_APP_ID' },
|
|
48
34
|
* });
|
|
49
35
|
* ```
|
|
50
36
|
*/
|
|
@@ -106,10 +92,6 @@ export interface DatalyrConfig {
|
|
|
106
92
|
};
|
|
107
93
|
/** SKAdNetwork template for automatic conversion value encoding (iOS only) */
|
|
108
94
|
skadTemplate?: 'ecommerce' | 'gaming' | 'subscription';
|
|
109
|
-
/** Meta (Facebook) SDK Configuration */
|
|
110
|
-
meta?: MetaConfig;
|
|
111
|
-
/** TikTok SDK Configuration */
|
|
112
|
-
tiktok?: TikTokConfig;
|
|
113
95
|
}
|
|
114
96
|
export interface EventData {
|
|
115
97
|
[key: string]: any;
|
|
@@ -205,3 +187,7 @@ export interface AttributionData {
|
|
|
205
187
|
clickId?: string;
|
|
206
188
|
installTime?: string;
|
|
207
189
|
}
|
|
190
|
+
/** Flat dictionary for Superwall's setUserAttributes() */
|
|
191
|
+
export type SuperwallAttributes = Record<string, string>;
|
|
192
|
+
/** Flat dictionary for RevenueCat's Purchases.setAttributes() */
|
|
193
|
+
export type RevenueCatAttributes = Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalyr/react-native",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Datalyr SDK for React Native & Expo - Server-side attribution tracking
|
|
3
|
+
"version": "1.6.1",
|
|
4
|
+
"description": "Datalyr SDK for React Native & Expo - Server-side attribution tracking for iOS and Android",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -37,8 +37,7 @@
|
|
|
37
37
|
"automatic-events",
|
|
38
38
|
"session-tracking",
|
|
39
39
|
"utm-tracking",
|
|
40
|
-
"
|
|
41
|
-
"tiktok-attribution",
|
|
40
|
+
"server-side-attribution",
|
|
42
41
|
"google-attribution",
|
|
43
42
|
"ios-attribution",
|
|
44
43
|
"android-attribution",
|
|
@@ -47,7 +46,6 @@
|
|
|
47
46
|
"gclid",
|
|
48
47
|
"conversion-tracking",
|
|
49
48
|
"revenue-optimization",
|
|
50
|
-
"deferred-deep-linking",
|
|
51
49
|
"fbclid",
|
|
52
50
|
"ttclid"
|
|
53
51
|
],
|
package/src/datalyr-sdk-expo.ts
CHANGED
|
@@ -34,7 +34,7 @@ import { journeyManager } from './journey';
|
|
|
34
34
|
import { createAutoEventsManager, AutoEventsManager } from './auto-events';
|
|
35
35
|
import { ConversionValueEncoder, ConversionTemplates } from './ConversionValueEncoder';
|
|
36
36
|
import { SKAdNetworkBridge } from './native/SKAdNetworkBridge';
|
|
37
|
-
import {
|
|
37
|
+
import { appleSearchAdsIntegration, playInstallReferrerIntegration } from './integrations';
|
|
38
38
|
import { DeferredDeepLinkResult } from './types';
|
|
39
39
|
import { AppleSearchAdsAttribution, AdvertiserInfoBridge } from './native/DatalyrNativeBridge';
|
|
40
40
|
|
|
@@ -172,33 +172,6 @@ export class DatalyrSDKExpo {
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
// Initialize platform SDKs (Meta/TikTok) if configured
|
|
176
|
-
if (config.meta) {
|
|
177
|
-
try {
|
|
178
|
-
await metaIntegration.initialize(config.meta, config.debug || false);
|
|
179
|
-
debugLog('Meta SDK initialized');
|
|
180
|
-
|
|
181
|
-
// Fetch deferred deep link data
|
|
182
|
-
if (config.meta.enableDeferredDeepLink) {
|
|
183
|
-
const deferredData = await metaIntegration.fetchDeferredDeepLink();
|
|
184
|
-
if (deferredData) {
|
|
185
|
-
await this.handleDeferredDeepLink(deferredData);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
} catch (error) {
|
|
189
|
-
errorLog('Failed to initialize Meta SDK:', error as Error);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
if (config.tiktok) {
|
|
194
|
-
try {
|
|
195
|
-
await tiktokIntegration.initialize(config.tiktok, config.debug || false);
|
|
196
|
-
debugLog('TikTok SDK initialized');
|
|
197
|
-
} catch (error) {
|
|
198
|
-
errorLog('Failed to initialize TikTok SDK:', error as Error);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
175
|
// Initialize Apple Search Ads attribution (iOS only, auto-fetches on init)
|
|
203
176
|
await appleSearchAdsIntegration.initialize(config.debug);
|
|
204
177
|
|
|
@@ -213,8 +186,6 @@ export class DatalyrSDKExpo {
|
|
|
213
186
|
}
|
|
214
187
|
|
|
215
188
|
debugLog('Platform integrations initialized', {
|
|
216
|
-
meta: metaIntegration.isAvailable(),
|
|
217
|
-
tiktok: tiktokIntegration.isAvailable(),
|
|
218
189
|
appleSearchAds: appleSearchAdsIntegration.isAvailable(),
|
|
219
190
|
playInstallReferrer: playInstallReferrerIntegration.isAvailable(),
|
|
220
191
|
});
|
|
@@ -225,7 +196,7 @@ export class DatalyrSDKExpo {
|
|
|
225
196
|
const installData = await attributionManager.trackInstall();
|
|
226
197
|
await this.track('app_install', {
|
|
227
198
|
platform: Platform.OS,
|
|
228
|
-
sdk_version: '1.
|
|
199
|
+
sdk_version: '1.6.1',
|
|
229
200
|
sdk_variant: 'expo',
|
|
230
201
|
...installData,
|
|
231
202
|
});
|
|
@@ -311,30 +282,6 @@ export class DatalyrSDKExpo {
|
|
|
311
282
|
}
|
|
312
283
|
}
|
|
313
284
|
|
|
314
|
-
// Forward user data to platform SDKs for Advanced Matching
|
|
315
|
-
if (metaIntegration.isAvailable() && properties) {
|
|
316
|
-
metaIntegration.setUserData({
|
|
317
|
-
email: properties.email,
|
|
318
|
-
phone: properties.phone,
|
|
319
|
-
firstName: properties.firstName || properties.first_name,
|
|
320
|
-
lastName: properties.lastName || properties.last_name,
|
|
321
|
-
city: properties.city,
|
|
322
|
-
state: properties.state,
|
|
323
|
-
zip: properties.zip || properties.zipCode || properties.postalCode,
|
|
324
|
-
country: properties.country,
|
|
325
|
-
gender: properties.gender,
|
|
326
|
-
dateOfBirth: properties.dateOfBirth || properties.dob || properties.birthday,
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
if (tiktokIntegration.isAvailable()) {
|
|
331
|
-
tiktokIntegration.identify(
|
|
332
|
-
properties?.email,
|
|
333
|
-
properties?.phone,
|
|
334
|
-
userId
|
|
335
|
-
);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
285
|
} catch (error) {
|
|
339
286
|
errorLog('Error identifying user:', error as Error);
|
|
340
287
|
}
|
|
@@ -436,11 +383,6 @@ export class DatalyrSDKExpo {
|
|
|
436
383
|
|
|
437
384
|
this.state.sessionId = await getOrCreateSessionId();
|
|
438
385
|
|
|
439
|
-
// Clear user data from platform SDKs
|
|
440
|
-
if (metaIntegration.isAvailable()) {
|
|
441
|
-
metaIntegration.clearUserData();
|
|
442
|
-
}
|
|
443
|
-
|
|
444
386
|
debugLog('User data reset completed');
|
|
445
387
|
|
|
446
388
|
} catch (error) {
|
|
@@ -567,14 +509,6 @@ export class DatalyrSDKExpo {
|
|
|
567
509
|
if (productId) properties.product_id = productId;
|
|
568
510
|
|
|
569
511
|
await this.trackWithSKAdNetwork('purchase', properties);
|
|
570
|
-
|
|
571
|
-
// Forward to platform SDKs
|
|
572
|
-
if (metaIntegration.isAvailable()) {
|
|
573
|
-
metaIntegration.logPurchase(value, currency, { productId });
|
|
574
|
-
}
|
|
575
|
-
if (tiktokIntegration.isAvailable()) {
|
|
576
|
-
tiktokIntegration.logPurchase(value, currency, productId);
|
|
577
|
-
}
|
|
578
512
|
}
|
|
579
513
|
|
|
580
514
|
async trackSubscription(value: number, currency = 'USD', plan?: string): Promise<void> {
|
|
@@ -582,14 +516,6 @@ export class DatalyrSDKExpo {
|
|
|
582
516
|
if (plan) properties.plan = plan;
|
|
583
517
|
|
|
584
518
|
await this.trackWithSKAdNetwork('subscribe', properties);
|
|
585
|
-
|
|
586
|
-
// Forward to platform SDKs
|
|
587
|
-
if (metaIntegration.isAvailable()) {
|
|
588
|
-
metaIntegration.logEvent('Subscribe', { value, currency, content_id: plan });
|
|
589
|
-
}
|
|
590
|
-
if (tiktokIntegration.isAvailable()) {
|
|
591
|
-
tiktokIntegration.logSubscription(value, currency, plan);
|
|
592
|
-
}
|
|
593
519
|
}
|
|
594
520
|
|
|
595
521
|
// Standard e-commerce events with platform forwarding
|
|
@@ -600,13 +526,6 @@ export class DatalyrSDKExpo {
|
|
|
600
526
|
if (contentName) properties.content_name = contentName;
|
|
601
527
|
|
|
602
528
|
await this.track('add_to_cart', properties);
|
|
603
|
-
|
|
604
|
-
if (metaIntegration.isAvailable()) {
|
|
605
|
-
metaIntegration.logEvent('AddToCart', { value, currency, content_id: contentId, content_name: contentName });
|
|
606
|
-
}
|
|
607
|
-
if (tiktokIntegration.isAvailable()) {
|
|
608
|
-
tiktokIntegration.logAddToCart(value, currency, contentId, contentName);
|
|
609
|
-
}
|
|
610
529
|
}
|
|
611
530
|
|
|
612
531
|
async trackViewContent(contentId: string, contentName?: string, contentType?: string, value?: number, currency?: string): Promise<void> {
|
|
@@ -617,13 +536,6 @@ export class DatalyrSDKExpo {
|
|
|
617
536
|
if (currency) properties.currency = currency;
|
|
618
537
|
|
|
619
538
|
await this.track('view_content', properties);
|
|
620
|
-
|
|
621
|
-
if (metaIntegration.isAvailable()) {
|
|
622
|
-
metaIntegration.logEvent('ViewContent', properties);
|
|
623
|
-
}
|
|
624
|
-
if (tiktokIntegration.isAvailable()) {
|
|
625
|
-
tiktokIntegration.logViewContent(contentId, contentName, contentType, value, currency);
|
|
626
|
-
}
|
|
627
539
|
}
|
|
628
540
|
|
|
629
541
|
async trackInitiateCheckout(value?: number, currency?: string, numItems?: number, contentIds?: string[]): Promise<void> {
|
|
@@ -634,13 +546,6 @@ export class DatalyrSDKExpo {
|
|
|
634
546
|
if (contentIds) properties.content_ids = contentIds;
|
|
635
547
|
|
|
636
548
|
await this.track('initiate_checkout', properties);
|
|
637
|
-
|
|
638
|
-
if (metaIntegration.isAvailable()) {
|
|
639
|
-
metaIntegration.logEvent('InitiateCheckout', properties);
|
|
640
|
-
}
|
|
641
|
-
if (tiktokIntegration.isAvailable()) {
|
|
642
|
-
tiktokIntegration.logInitiateCheckout(value, currency, numItems, contentIds);
|
|
643
|
-
}
|
|
644
549
|
}
|
|
645
550
|
|
|
646
551
|
async trackCompleteRegistration(registrationMethod?: string): Promise<void> {
|
|
@@ -648,13 +553,6 @@ export class DatalyrSDKExpo {
|
|
|
648
553
|
if (registrationMethod) properties.registration_method = registrationMethod;
|
|
649
554
|
|
|
650
555
|
await this.track('complete_registration', properties);
|
|
651
|
-
|
|
652
|
-
if (metaIntegration.isAvailable()) {
|
|
653
|
-
metaIntegration.logEvent('CompleteRegistration', properties);
|
|
654
|
-
}
|
|
655
|
-
if (tiktokIntegration.isAvailable()) {
|
|
656
|
-
tiktokIntegration.logCompleteRegistration(registrationMethod);
|
|
657
|
-
}
|
|
658
556
|
}
|
|
659
557
|
|
|
660
558
|
async trackSearch(searchString: string, contentIds?: string[]): Promise<void> {
|
|
@@ -662,13 +560,6 @@ export class DatalyrSDKExpo {
|
|
|
662
560
|
if (contentIds) properties.content_ids = contentIds;
|
|
663
561
|
|
|
664
562
|
await this.track('search', properties);
|
|
665
|
-
|
|
666
|
-
if (metaIntegration.isAvailable()) {
|
|
667
|
-
metaIntegration.logEvent('Search', properties);
|
|
668
|
-
}
|
|
669
|
-
if (tiktokIntegration.isAvailable()) {
|
|
670
|
-
tiktokIntegration.logSearch(searchString, contentIds);
|
|
671
|
-
}
|
|
672
563
|
}
|
|
673
564
|
|
|
674
565
|
async trackLead(value?: number, currency?: string): Promise<void> {
|
|
@@ -677,13 +568,6 @@ export class DatalyrSDKExpo {
|
|
|
677
568
|
if (currency) properties.currency = currency;
|
|
678
569
|
|
|
679
570
|
await this.track('lead', properties);
|
|
680
|
-
|
|
681
|
-
if (metaIntegration.isAvailable()) {
|
|
682
|
-
metaIntegration.logEvent('Lead', properties);
|
|
683
|
-
}
|
|
684
|
-
if (tiktokIntegration.isAvailable()) {
|
|
685
|
-
tiktokIntegration.logLead(value, currency);
|
|
686
|
-
}
|
|
687
571
|
}
|
|
688
572
|
|
|
689
573
|
async trackAddPaymentInfo(success?: boolean): Promise<void> {
|
|
@@ -691,28 +575,16 @@ export class DatalyrSDKExpo {
|
|
|
691
575
|
if (success !== undefined) properties.success = success;
|
|
692
576
|
|
|
693
577
|
await this.track('add_payment_info', properties);
|
|
694
|
-
|
|
695
|
-
if (metaIntegration.isAvailable()) {
|
|
696
|
-
metaIntegration.logEvent('AddPaymentInfo', properties);
|
|
697
|
-
}
|
|
698
|
-
if (tiktokIntegration.isAvailable()) {
|
|
699
|
-
tiktokIntegration.logAddPaymentInfo(success);
|
|
700
|
-
}
|
|
701
578
|
}
|
|
702
579
|
|
|
703
580
|
// Platform integration methods
|
|
704
581
|
|
|
705
582
|
getDeferredAttributionData(): DeferredDeepLinkResult | null {
|
|
706
|
-
if (metaIntegration.isAvailable()) {
|
|
707
|
-
return metaIntegration.getDeferredDeepLinkData();
|
|
708
|
-
}
|
|
709
583
|
return null;
|
|
710
584
|
}
|
|
711
585
|
|
|
712
|
-
getPlatformIntegrationStatus(): {
|
|
586
|
+
getPlatformIntegrationStatus(): { appleSearchAds: boolean; playInstallReferrer: boolean } {
|
|
713
587
|
return {
|
|
714
|
-
meta: metaIntegration.isAvailable(),
|
|
715
|
-
tiktok: tiktokIntegration.isAvailable(),
|
|
716
588
|
appleSearchAds: appleSearchAdsIntegration.isAvailable(),
|
|
717
589
|
playInstallReferrer: playInstallReferrerIntegration.isAvailable(),
|
|
718
590
|
};
|
|
@@ -734,14 +606,88 @@ export class DatalyrSDKExpo {
|
|
|
734
606
|
return appleSearchAdsIntegration.getAttributionData();
|
|
735
607
|
}
|
|
736
608
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
609
|
+
// MARK: - Third-Party Integration Methods
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Get attribution data formatted for Superwall's setUserAttributes()
|
|
613
|
+
*/
|
|
614
|
+
getSuperwallAttributes(): Record<string, string> {
|
|
615
|
+
const attribution = attributionManager.getAttributionData();
|
|
616
|
+
const advertiser = this.cachedAdvertiserInfo;
|
|
617
|
+
const attrs: Record<string, string> = {};
|
|
618
|
+
|
|
619
|
+
const set = (key: string, value: any) => {
|
|
620
|
+
if (value != null && String(value) !== '') attrs[key] = String(value);
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
set('datalyr_id', this.state.visitorId);
|
|
624
|
+
set('media_source', attribution.utm_source);
|
|
625
|
+
set('campaign', attribution.utm_campaign);
|
|
626
|
+
set('adgroup', attribution.adset_id || attribution.utm_content);
|
|
627
|
+
set('ad', attribution.ad_id);
|
|
628
|
+
set('keyword', attribution.keyword);
|
|
629
|
+
set('network', attribution.network);
|
|
630
|
+
set('utm_source', attribution.utm_source);
|
|
631
|
+
set('utm_medium', attribution.utm_medium);
|
|
632
|
+
set('utm_campaign', attribution.utm_campaign);
|
|
633
|
+
set('utm_term', attribution.utm_term);
|
|
634
|
+
set('utm_content', attribution.utm_content);
|
|
635
|
+
set('lyr', attribution.lyr);
|
|
636
|
+
set('fbclid', attribution.fbclid);
|
|
637
|
+
set('gclid', attribution.gclid);
|
|
638
|
+
set('ttclid', attribution.ttclid);
|
|
639
|
+
set('idfa', advertiser?.idfa);
|
|
640
|
+
set('gaid', advertiser?.gaid);
|
|
641
|
+
set('att_status', advertiser?.att_status);
|
|
642
|
+
|
|
643
|
+
return attrs;
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Get attribution data formatted for RevenueCat's Purchases.setAttributes()
|
|
648
|
+
*/
|
|
649
|
+
getRevenueCatAttributes(): Record<string, string> {
|
|
650
|
+
const attribution = attributionManager.getAttributionData();
|
|
651
|
+
const advertiser = this.cachedAdvertiserInfo;
|
|
652
|
+
const attrs: Record<string, string> = {};
|
|
653
|
+
|
|
654
|
+
const set = (key: string, value: any) => {
|
|
655
|
+
if (value != null && String(value) !== '') attrs[key] = String(value);
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
// Reserved attributes ($ prefix)
|
|
659
|
+
set('$datalyrId', this.state.visitorId);
|
|
660
|
+
set('$mediaSource', attribution.utm_source);
|
|
661
|
+
set('$campaign', attribution.utm_campaign);
|
|
662
|
+
set('$adGroup', attribution.adset_id);
|
|
663
|
+
set('$ad', attribution.ad_id);
|
|
664
|
+
set('$keyword', attribution.keyword);
|
|
665
|
+
set('$idfa', advertiser?.idfa);
|
|
666
|
+
set('$gpsAdId', advertiser?.gaid);
|
|
667
|
+
if (advertiser?.att_status != null) {
|
|
668
|
+
const statusMap: Record<number, string> = { 0: 'notDetermined', 1: 'restricted', 2: 'denied', 3: 'authorized' };
|
|
669
|
+
set('$attConsentStatus', statusMap[advertiser.att_status] || String(advertiser.att_status));
|
|
743
670
|
}
|
|
744
671
|
|
|
672
|
+
// Custom attributes
|
|
673
|
+
set('utm_source', attribution.utm_source);
|
|
674
|
+
set('utm_medium', attribution.utm_medium);
|
|
675
|
+
set('utm_campaign', attribution.utm_campaign);
|
|
676
|
+
set('utm_term', attribution.utm_term);
|
|
677
|
+
set('utm_content', attribution.utm_content);
|
|
678
|
+
set('lyr', attribution.lyr);
|
|
679
|
+
set('fbclid', attribution.fbclid);
|
|
680
|
+
set('gclid', attribution.gclid);
|
|
681
|
+
set('ttclid', attribution.ttclid);
|
|
682
|
+
set('wbraid', attribution.wbraid);
|
|
683
|
+
set('gbraid', attribution.gbraid);
|
|
684
|
+
set('network', attribution.network);
|
|
685
|
+
set('creative_id', attribution.creative_id);
|
|
686
|
+
|
|
687
|
+
return attrs;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
async updateTrackingAuthorization(authorized: boolean): Promise<void> {
|
|
745
691
|
// Refresh cached advertiser info after ATT status change
|
|
746
692
|
try {
|
|
747
693
|
this.cachedAdvertiserInfo = await AdvertiserInfoBridge.getAdvertiserInfo();
|
|
@@ -835,9 +781,9 @@ export class DatalyrSDKExpo {
|
|
|
835
781
|
carrier: deviceInfo.carrier,
|
|
836
782
|
network_type: networkType,
|
|
837
783
|
timestamp: Date.now(),
|
|
838
|
-
sdk_version: '1.
|
|
784
|
+
sdk_version: '1.6.1',
|
|
839
785
|
sdk_variant: 'expo',
|
|
840
|
-
// Advertiser data (IDFA/GAID, ATT status) for
|
|
786
|
+
// Advertiser data (IDFA/GAID, ATT status) for server-side postback
|
|
841
787
|
...(advertiserInfo ? {
|
|
842
788
|
idfa: advertiserInfo.idfa,
|
|
843
789
|
idfv: advertiserInfo.idfv,
|
|
@@ -1080,7 +1026,7 @@ export class DatalyrExpo {
|
|
|
1080
1026
|
return datalyrExpo.getDeferredAttributionData();
|
|
1081
1027
|
}
|
|
1082
1028
|
|
|
1083
|
-
static getPlatformIntegrationStatus(): {
|
|
1029
|
+
static getPlatformIntegrationStatus(): { appleSearchAds: boolean; playInstallReferrer: boolean } {
|
|
1084
1030
|
return datalyrExpo.getPlatformIntegrationStatus();
|
|
1085
1031
|
}
|
|
1086
1032
|
|
|
@@ -1095,6 +1041,16 @@ export class DatalyrExpo {
|
|
|
1095
1041
|
static async updateTrackingAuthorization(authorized: boolean): Promise<void> {
|
|
1096
1042
|
await datalyrExpo.updateTrackingAuthorization(authorized);
|
|
1097
1043
|
}
|
|
1044
|
+
|
|
1045
|
+
// Third-party integration methods
|
|
1046
|
+
|
|
1047
|
+
static getSuperwallAttributes(): Record<string, string> {
|
|
1048
|
+
return datalyrExpo.getSuperwallAttributes();
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
static getRevenueCatAttributes(): Record<string, string> {
|
|
1052
|
+
return datalyrExpo.getRevenueCatAttributes();
|
|
1053
|
+
}
|
|
1098
1054
|
}
|
|
1099
1055
|
|
|
1100
1056
|
export default datalyrExpo;
|