@magicfeedback/popup-sdk 1.1.3 → 1.1.4
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/dist/index.d.mts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +24 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react-native.d.mts +24 -0
- package/dist/react-native.d.ts +24 -0
- package/dist/react-native.js +23 -2
- package/dist/react-native.js.map +1 -1
- package/dist/react-native.mjs +23 -2
- package/dist/react-native.mjs.map +1 -1
- package/package.json +1 -1
package/dist/react-native.d.mts
CHANGED
|
@@ -240,6 +240,28 @@ interface ReactNativeErrorUtils {
|
|
|
240
240
|
setGlobalHandler(handler: (error: unknown, isFatal?: boolean) => void): void;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Messaging (#18–22): tracking de notificaciones del host (push / in-app).
|
|
245
|
+
* Un único evento reservado `deepdots_message` con un campo `stage` discriminador;
|
|
246
|
+
* el funnel se correlaciona por `message_id` y se agrupa por `message_title`.
|
|
247
|
+
*/
|
|
248
|
+
type MessageStage = 'delivered' | 'clicked' | 'converted';
|
|
249
|
+
interface TrackMessageOptions {
|
|
250
|
+
/** Identificador del mensaje/notificación — correlaciona el funnel delivered→clicked→converted. */
|
|
251
|
+
id: string;
|
|
252
|
+
/** Título del mensaje — dimensión de agrupación de #18–22. */
|
|
253
|
+
title: string;
|
|
254
|
+
/** Canal de entrega. */
|
|
255
|
+
channel: 'push' | 'in_app';
|
|
256
|
+
/** Nombre de la campaña (opcional). */
|
|
257
|
+
campaign?: string;
|
|
258
|
+
/** Valor de conversión (opcional, típico en `stage: 'converted'`). */
|
|
259
|
+
value?: number;
|
|
260
|
+
currency?: string;
|
|
261
|
+
/** Parámetros libres adicionales. */
|
|
262
|
+
params?: Record<string, unknown>;
|
|
263
|
+
}
|
|
264
|
+
|
|
243
265
|
/**
|
|
244
266
|
* Main class for managing survey popups
|
|
245
267
|
*/
|
|
@@ -311,6 +333,8 @@ declare class DeepdotsPopups {
|
|
|
311
333
|
trackFindabilityFriction(frictionTopic: string, params?: Record<string, unknown>): void;
|
|
312
334
|
/** Funnel: un paso del embudo, correlacionado por `taskId`. El backend reconstruye conversión/drop-off/tiempo. */
|
|
313
335
|
trackFunnelStep(funnel: string, step: string, taskId: string, params?: Record<string, unknown>): void;
|
|
336
|
+
/** Messaging (#18–22): registra una etapa del funnel de una notificación (push/in-app). No-op si tracking off. */
|
|
337
|
+
trackMessage(stage: MessageStage, options: TrackMessageOptions): void;
|
|
314
338
|
/**
|
|
315
339
|
* Navegación MANUAL (entornos sin History API, p. ej. React Native con React Navigation).
|
|
316
340
|
* El host la llama en cada cambio de pantalla; emite `page_view` al salir de la anterior.
|
package/dist/react-native.d.ts
CHANGED
|
@@ -240,6 +240,28 @@ interface ReactNativeErrorUtils {
|
|
|
240
240
|
setGlobalHandler(handler: (error: unknown, isFatal?: boolean) => void): void;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
+
/**
|
|
244
|
+
* Messaging (#18–22): tracking de notificaciones del host (push / in-app).
|
|
245
|
+
* Un único evento reservado `deepdots_message` con un campo `stage` discriminador;
|
|
246
|
+
* el funnel se correlaciona por `message_id` y se agrupa por `message_title`.
|
|
247
|
+
*/
|
|
248
|
+
type MessageStage = 'delivered' | 'clicked' | 'converted';
|
|
249
|
+
interface TrackMessageOptions {
|
|
250
|
+
/** Identificador del mensaje/notificación — correlaciona el funnel delivered→clicked→converted. */
|
|
251
|
+
id: string;
|
|
252
|
+
/** Título del mensaje — dimensión de agrupación de #18–22. */
|
|
253
|
+
title: string;
|
|
254
|
+
/** Canal de entrega. */
|
|
255
|
+
channel: 'push' | 'in_app';
|
|
256
|
+
/** Nombre de la campaña (opcional). */
|
|
257
|
+
campaign?: string;
|
|
258
|
+
/** Valor de conversión (opcional, típico en `stage: 'converted'`). */
|
|
259
|
+
value?: number;
|
|
260
|
+
currency?: string;
|
|
261
|
+
/** Parámetros libres adicionales. */
|
|
262
|
+
params?: Record<string, unknown>;
|
|
263
|
+
}
|
|
264
|
+
|
|
243
265
|
/**
|
|
244
266
|
* Main class for managing survey popups
|
|
245
267
|
*/
|
|
@@ -311,6 +333,8 @@ declare class DeepdotsPopups {
|
|
|
311
333
|
trackFindabilityFriction(frictionTopic: string, params?: Record<string, unknown>): void;
|
|
312
334
|
/** Funnel: un paso del embudo, correlacionado por `taskId`. El backend reconstruye conversión/drop-off/tiempo. */
|
|
313
335
|
trackFunnelStep(funnel: string, step: string, taskId: string, params?: Record<string, unknown>): void;
|
|
336
|
+
/** Messaging (#18–22): registra una etapa del funnel de una notificación (push/in-app). No-op si tracking off. */
|
|
337
|
+
trackMessage(stage: MessageStage, options: TrackMessageOptions): void;
|
|
314
338
|
/**
|
|
315
339
|
* Navegación MANUAL (entornos sin History API, p. ej. React Native con React Navigation).
|
|
316
340
|
* El host la llama en cada cambio de pantalla; emite `page_view` al salir de la anterior.
|
package/dist/react-native.js
CHANGED
|
@@ -2460,11 +2460,27 @@ var CrashReporter = class {
|
|
|
2460
2460
|
}
|
|
2461
2461
|
};
|
|
2462
2462
|
|
|
2463
|
+
// src/analytics/messaging.ts
|
|
2464
|
+
function buildMessageParams(stage, o) {
|
|
2465
|
+
const p = {
|
|
2466
|
+
stage,
|
|
2467
|
+
message_id: o.id,
|
|
2468
|
+
message_title: o.title,
|
|
2469
|
+
channel: o.channel
|
|
2470
|
+
};
|
|
2471
|
+
if (o.campaign) p.campaign = o.campaign;
|
|
2472
|
+
if (o.value !== void 0) p.value = o.value;
|
|
2473
|
+
if (o.currency) p.currency = o.currency;
|
|
2474
|
+
return { ...p, ...o.params ?? {} };
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2463
2477
|
// src/core/deepdots-popups.ts
|
|
2464
2478
|
var EXIT_QUEUE_STORAGE_KEY = "__deepdots_exit_popup_queue__";
|
|
2465
2479
|
var DAY_IN_MS = 24 * 60 * 60 * 1e3;
|
|
2466
2480
|
var ANALYTICS_MAX_BATCH_SIZE = 20;
|
|
2467
2481
|
var ANALYTICS_FLUSH_INTERVAL_MS = 3e4;
|
|
2482
|
+
var RESERVED_EVENT_PREFIX = "deepdots_";
|
|
2483
|
+
var CUSTOM_EVENT_PREFIX = "deepdots_event_";
|
|
2468
2484
|
var DeepdotsPopups = class {
|
|
2469
2485
|
constructor() {
|
|
2470
2486
|
this.config = null;
|
|
@@ -2617,8 +2633,9 @@ var DeepdotsPopups = class {
|
|
|
2617
2633
|
/** Registra un evento de analítica (modelo GA: nombre + params). No-op si tracking off. */
|
|
2618
2634
|
track(name, params) {
|
|
2619
2635
|
if (!this.tracking?.isTrackingEnabled()) return;
|
|
2620
|
-
|
|
2621
|
-
this.
|
|
2636
|
+
const eventName = name.startsWith(RESERVED_EVENT_PREFIX) ? name : `${CUSTOM_EVENT_PREFIX}${name}`;
|
|
2637
|
+
this.analytics?.track(eventName, params);
|
|
2638
|
+
this.log("analytics \xB7 track:", eventName, params ?? {});
|
|
2622
2639
|
}
|
|
2623
2640
|
/** User attributes para breakdowns (registration_status, pass_type, sector, pass_status…). */
|
|
2624
2641
|
setUserAttributes(attributes) {
|
|
@@ -2670,6 +2687,10 @@ var DeepdotsPopups = class {
|
|
|
2670
2687
|
trackFunnelStep(funnel, step, taskId, params) {
|
|
2671
2688
|
this.track("deepdots_funnel_step", { funnel, step, task_id: taskId, ...params ?? {} });
|
|
2672
2689
|
}
|
|
2690
|
+
/** Messaging (#18–22): registra una etapa del funnel de una notificación (push/in-app). No-op si tracking off. */
|
|
2691
|
+
trackMessage(stage, options) {
|
|
2692
|
+
this.track("deepdots_message", buildMessageParams(stage, options));
|
|
2693
|
+
}
|
|
2673
2694
|
/**
|
|
2674
2695
|
* Navegación MANUAL (entornos sin History API, p. ej. React Native con React Navigation).
|
|
2675
2696
|
* El host la llama en cada cambio de pantalla; emite `page_view` al salir de la anterior.
|