@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/index.mjs
CHANGED
|
@@ -921,11 +921,27 @@ var CrashReporter = class {
|
|
|
921
921
|
}
|
|
922
922
|
};
|
|
923
923
|
|
|
924
|
+
// src/analytics/messaging.ts
|
|
925
|
+
function buildMessageParams(stage, o) {
|
|
926
|
+
const p = {
|
|
927
|
+
stage,
|
|
928
|
+
message_id: o.id,
|
|
929
|
+
message_title: o.title,
|
|
930
|
+
channel: o.channel
|
|
931
|
+
};
|
|
932
|
+
if (o.campaign) p.campaign = o.campaign;
|
|
933
|
+
if (o.value !== void 0) p.value = o.value;
|
|
934
|
+
if (o.currency) p.currency = o.currency;
|
|
935
|
+
return { ...p, ...o.params ?? {} };
|
|
936
|
+
}
|
|
937
|
+
|
|
924
938
|
// src/core/deepdots-popups.ts
|
|
925
939
|
var EXIT_QUEUE_STORAGE_KEY = "__deepdots_exit_popup_queue__";
|
|
926
940
|
var DAY_IN_MS = 24 * 60 * 60 * 1e3;
|
|
927
941
|
var ANALYTICS_MAX_BATCH_SIZE = 20;
|
|
928
942
|
var ANALYTICS_FLUSH_INTERVAL_MS = 3e4;
|
|
943
|
+
var RESERVED_EVENT_PREFIX = "deepdots_";
|
|
944
|
+
var CUSTOM_EVENT_PREFIX = "deepdots_event_";
|
|
929
945
|
var DeepdotsPopups = class {
|
|
930
946
|
constructor() {
|
|
931
947
|
this.config = null;
|
|
@@ -1078,8 +1094,9 @@ var DeepdotsPopups = class {
|
|
|
1078
1094
|
/** Registra un evento de analítica (modelo GA: nombre + params). No-op si tracking off. */
|
|
1079
1095
|
track(name, params) {
|
|
1080
1096
|
if (!this.tracking?.isTrackingEnabled()) return;
|
|
1081
|
-
|
|
1082
|
-
this.
|
|
1097
|
+
const eventName = name.startsWith(RESERVED_EVENT_PREFIX) ? name : `${CUSTOM_EVENT_PREFIX}${name}`;
|
|
1098
|
+
this.analytics?.track(eventName, params);
|
|
1099
|
+
this.log("analytics \xB7 track:", eventName, params ?? {});
|
|
1083
1100
|
}
|
|
1084
1101
|
/** User attributes para breakdowns (registration_status, pass_type, sector, pass_status…). */
|
|
1085
1102
|
setUserAttributes(attributes) {
|
|
@@ -1131,6 +1148,10 @@ var DeepdotsPopups = class {
|
|
|
1131
1148
|
trackFunnelStep(funnel, step, taskId, params) {
|
|
1132
1149
|
this.track("deepdots_funnel_step", { funnel, step, task_id: taskId, ...params ?? {} });
|
|
1133
1150
|
}
|
|
1151
|
+
/** Messaging (#18–22): registra una etapa del funnel de una notificación (push/in-app). No-op si tracking off. */
|
|
1152
|
+
trackMessage(stage, options) {
|
|
1153
|
+
this.track("deepdots_message", buildMessageParams(stage, options));
|
|
1154
|
+
}
|
|
1134
1155
|
/**
|
|
1135
1156
|
* Navegación MANUAL (entornos sin History API, p. ej. React Native con React Navigation).
|
|
1136
1157
|
* El host la llama en cada cambio de pantalla; emite `page_view` al salir de la anterior.
|
|
@@ -1884,6 +1905,7 @@ export {
|
|
|
1884
1905
|
POPUP_TRIGGER_CONDITION_STATUSES,
|
|
1885
1906
|
ReactNativePopupRenderer,
|
|
1886
1907
|
buildAnalyticsFeedbackBody,
|
|
1908
|
+
buildMessageParams,
|
|
1887
1909
|
buildSurveyHtml,
|
|
1888
1910
|
collectRnDevice,
|
|
1889
1911
|
crashRecordToParams,
|