@datlv-trustshop/shopify-inapp-components 0.1.26 → 0.1.27
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.
|
@@ -37,8 +37,6 @@ export async function trackCampaignView(shopId, campaignId, metadata) {
|
|
|
37
37
|
// Check for deduplication
|
|
38
38
|
const lastTracked = viewTrackingMap.get(dedupKey);
|
|
39
39
|
if (lastTracked && (now - lastTracked) < VIEW_DEDUP_THRESHOLD_MS) {
|
|
40
|
-
// Skip tracking - still within dedup threshold
|
|
41
|
-
console.log(`⏭️ [Campaign Tracking] View skipped (dedup) for campaign ${campaignId} - last tracked ${now - lastTracked}ms ago`);
|
|
42
40
|
return;
|
|
43
41
|
}
|
|
44
42
|
// Update tracking map
|
|
@@ -53,10 +51,6 @@ export async function trackCampaignView(shopId, campaignId, metadata) {
|
|
|
53
51
|
},
|
|
54
52
|
};
|
|
55
53
|
const url = `${TRACKING_BASE_URL}/api/shops/${shopId}/campaigns/${campaignId}/track/view`;
|
|
56
|
-
// Log tracking attempt in development
|
|
57
|
-
console.log(`👁️ [Campaign Tracking] VIEW tracked for campaign ${campaignId}`);
|
|
58
|
-
console.log(`📍 URL: ${url}`);
|
|
59
|
-
console.log(`📦 Payload:`, payload);
|
|
60
54
|
// Fire and forget - no await, no error handling that would break UI
|
|
61
55
|
void fetch(url, {
|
|
62
56
|
method: 'POST',
|
|
@@ -79,7 +73,6 @@ export async function trackCampaignClick(shopId, campaignId, options = {}) {
|
|
|
79
73
|
const { actionType, ctaId, ctaKey, timeToAction, metadata } = options;
|
|
80
74
|
// Validate that at least one required field is present
|
|
81
75
|
if (!actionType && !ctaId && !ctaKey) {
|
|
82
|
-
console.warn('[Campaign Tracking] Click tracking requires at least one of: action_type, cta_id, cta_key');
|
|
83
76
|
return;
|
|
84
77
|
}
|
|
85
78
|
const sessionId = getSessionId();
|
|
@@ -102,11 +95,6 @@ export async function trackCampaignClick(shopId, campaignId, options = {}) {
|
|
|
102
95
|
if (timeToAction !== undefined)
|
|
103
96
|
payload.time_to_action = timeToAction;
|
|
104
97
|
const url = `${TRACKING_BASE_URL}/api/shops/${shopId}/campaigns/${campaignId}/track/click`;
|
|
105
|
-
// Log tracking attempt in development
|
|
106
|
-
console.log(`🖱️ [Campaign Tracking] CLICK tracked for campaign ${campaignId}`);
|
|
107
|
-
console.log(`📍 URL: ${url}`);
|
|
108
|
-
console.log(`📦 Payload:`, payload);
|
|
109
|
-
console.log(`⏱️ Time to action: ${timeToAction}ms`);
|
|
110
98
|
// Fire and forget - no await, no error handling that would break UI
|
|
111
99
|
void fetch(url, {
|
|
112
100
|
method: 'POST',
|