@heycater/qualification-funnel 1.15.0 → 1.16.0

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.esm.js CHANGED
@@ -10052,8 +10052,19 @@ const Adornment = styled.div`
10052
10052
  top: 50%;
10053
10053
  transform: translateY(-50%);
10054
10054
  `;
10055
+ const sessionSequence = /* @__PURE__ */ new Map();
10056
+ function getNextSequence(sessionId) {
10057
+ const current = sessionSequence.get(sessionId) || 0;
10058
+ const next = current + 1;
10059
+ sessionSequence.set(sessionId, next);
10060
+ return next;
10061
+ }
10055
10062
  function captureEvent(eventName, properties) {
10056
10063
  if (typeof window === "undefined") return;
10064
+ const sessionId = properties.session_id;
10065
+ if (sessionId) {
10066
+ properties.event_sequence = getNextSequence(sessionId);
10067
+ }
10057
10068
  if (window.posthog) {
10058
10069
  try {
10059
10070
  window.posthog.capture(eventName, properties);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",