@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.mjs
CHANGED
|
@@ -926,11 +926,27 @@ var CrashReporter = class {
|
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
928
|
|
|
929
|
+
// src/analytics/messaging.ts
|
|
930
|
+
function buildMessageParams(stage, o) {
|
|
931
|
+
const p = {
|
|
932
|
+
stage,
|
|
933
|
+
message_id: o.id,
|
|
934
|
+
message_title: o.title,
|
|
935
|
+
channel: o.channel
|
|
936
|
+
};
|
|
937
|
+
if (o.campaign) p.campaign = o.campaign;
|
|
938
|
+
if (o.value !== void 0) p.value = o.value;
|
|
939
|
+
if (o.currency) p.currency = o.currency;
|
|
940
|
+
return { ...p, ...o.params ?? {} };
|
|
941
|
+
}
|
|
942
|
+
|
|
929
943
|
// src/core/deepdots-popups.ts
|
|
930
944
|
var EXIT_QUEUE_STORAGE_KEY = "__deepdots_exit_popup_queue__";
|
|
931
945
|
var DAY_IN_MS = 24 * 60 * 60 * 1e3;
|
|
932
946
|
var ANALYTICS_MAX_BATCH_SIZE = 20;
|
|
933
947
|
var ANALYTICS_FLUSH_INTERVAL_MS = 3e4;
|
|
948
|
+
var RESERVED_EVENT_PREFIX = "deepdots_";
|
|
949
|
+
var CUSTOM_EVENT_PREFIX = "deepdots_event_";
|
|
934
950
|
var DeepdotsPopups = class {
|
|
935
951
|
constructor() {
|
|
936
952
|
this.config = null;
|
|
@@ -1083,8 +1099,9 @@ var DeepdotsPopups = class {
|
|
|
1083
1099
|
/** Registra un evento de analítica (modelo GA: nombre + params). No-op si tracking off. */
|
|
1084
1100
|
track(name, params) {
|
|
1085
1101
|
if (!this.tracking?.isTrackingEnabled()) return;
|
|
1086
|
-
|
|
1087
|
-
this.
|
|
1102
|
+
const eventName = name.startsWith(RESERVED_EVENT_PREFIX) ? name : `${CUSTOM_EVENT_PREFIX}${name}`;
|
|
1103
|
+
this.analytics?.track(eventName, params);
|
|
1104
|
+
this.log("analytics \xB7 track:", eventName, params ?? {});
|
|
1088
1105
|
}
|
|
1089
1106
|
/** User attributes para breakdowns (registration_status, pass_type, sector, pass_status…). */
|
|
1090
1107
|
setUserAttributes(attributes) {
|
|
@@ -1136,6 +1153,10 @@ var DeepdotsPopups = class {
|
|
|
1136
1153
|
trackFunnelStep(funnel, step, taskId, params) {
|
|
1137
1154
|
this.track("deepdots_funnel_step", { funnel, step, task_id: taskId, ...params ?? {} });
|
|
1138
1155
|
}
|
|
1156
|
+
/** Messaging (#18–22): registra una etapa del funnel de una notificación (push/in-app). No-op si tracking off. */
|
|
1157
|
+
trackMessage(stage, options) {
|
|
1158
|
+
this.track("deepdots_message", buildMessageParams(stage, options));
|
|
1159
|
+
}
|
|
1139
1160
|
/**
|
|
1140
1161
|
* Navegación MANUAL (entornos sin History API, p. ej. React Native con React Navigation).
|
|
1141
1162
|
* El host la llama en cada cambio de pantalla; emite `page_view` al salir de la anterior.
|