wingbot 3.62.0 → 3.62.1
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/package.json
CHANGED
|
@@ -536,69 +536,68 @@ function onInteractionHandler (
|
|
|
536
536
|
}))
|
|
537
537
|
);
|
|
538
538
|
|
|
539
|
-
if (
|
|
540
|
-
if (req.isText()) {
|
|
541
|
-
trackEvents.push({
|
|
542
|
-
type: TrackingType.TRAINING,
|
|
543
|
-
// @ts-ignore
|
|
544
|
-
lastAction,
|
|
545
|
-
category: asCategory(TrackingCategory.INTENT_DETECTION),
|
|
546
|
-
intent,
|
|
547
|
-
action,
|
|
548
|
-
label: text,
|
|
549
|
-
value: score >= ai.confidence ? 0 : 1,
|
|
550
|
-
...langsExtension
|
|
551
|
-
});
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
let actionCategory;
|
|
555
|
-
let label = noneAction;
|
|
556
|
-
|
|
557
|
-
if (isPassThread) {
|
|
558
|
-
actionCategory = TrackingCategory.HANDOVER_TO_BOT;
|
|
559
|
-
} else if (req.isSticker()) {
|
|
560
|
-
actionCategory = TrackingCategory.STICKER;
|
|
561
|
-
label = req.attachmentUrl(0);
|
|
562
|
-
} else if (req.isImage()) {
|
|
563
|
-
actionCategory = TrackingCategory.IMAGE;
|
|
564
|
-
label = req.attachmentUrl(0);
|
|
565
|
-
} else if (req.hasLocation()) {
|
|
566
|
-
actionCategory = TrackingCategory.LOCATION;
|
|
567
|
-
const { lat, long } = req.getLocation();
|
|
568
|
-
label = `${lat}, ${long}`;
|
|
569
|
-
} else if (isAttachment) {
|
|
570
|
-
actionCategory = TrackingCategory.ATTACHMENT;
|
|
571
|
-
label = req.attachment(0).type;
|
|
572
|
-
} else if (isText) {
|
|
573
|
-
actionCategory = TrackingCategory.TEXT;
|
|
574
|
-
label = text;
|
|
575
|
-
} else if (isQuickReply) {
|
|
576
|
-
actionCategory = TrackingCategory.QUICK_REPLY;
|
|
577
|
-
label = text;
|
|
578
|
-
} else if (req.isOptin()) {
|
|
579
|
-
actionCategory = TrackingCategory.OPT_IN;
|
|
580
|
-
} else if (req.isReferral()) {
|
|
581
|
-
actionCategory = TrackingCategory.REFERRAL;
|
|
582
|
-
} else if (isPostback) {
|
|
583
|
-
actionCategory = TrackingCategory.POSTBACK_BUTTON;
|
|
584
|
-
label = req.event.postback.title || (useExtendedScalars ? null : '(unknown)');
|
|
585
|
-
} else {
|
|
586
|
-
actionCategory = TrackingCategory.OTHER;
|
|
587
|
-
}
|
|
588
|
-
|
|
539
|
+
if (req.isText()) {
|
|
589
540
|
trackEvents.push({
|
|
590
|
-
|
|
591
|
-
|
|
541
|
+
type: TrackingType.TRAINING,
|
|
542
|
+
// @ts-ignore
|
|
592
543
|
lastAction,
|
|
593
|
-
category: asCategory(
|
|
544
|
+
category: asCategory(TrackingCategory.INTENT_DETECTION),
|
|
545
|
+
intent,
|
|
594
546
|
action,
|
|
595
|
-
label,
|
|
596
|
-
value,
|
|
597
|
-
pageCategory,
|
|
547
|
+
label: text,
|
|
548
|
+
value: score >= ai.confidence ? 0 : 1,
|
|
598
549
|
...langsExtension
|
|
599
550
|
});
|
|
600
551
|
}
|
|
601
552
|
|
|
553
|
+
let actionCategory;
|
|
554
|
+
let label = noneAction;
|
|
555
|
+
|
|
556
|
+
if (isPassThread) {
|
|
557
|
+
actionCategory = TrackingCategory.HANDOVER_TO_BOT;
|
|
558
|
+
} else if (req.isSticker()) {
|
|
559
|
+
actionCategory = TrackingCategory.STICKER;
|
|
560
|
+
label = req.attachmentUrl(0);
|
|
561
|
+
} else if (req.isImage()) {
|
|
562
|
+
actionCategory = TrackingCategory.IMAGE;
|
|
563
|
+
label = req.attachmentUrl(0);
|
|
564
|
+
} else if (req.hasLocation()) {
|
|
565
|
+
actionCategory = TrackingCategory.LOCATION;
|
|
566
|
+
const { lat, long } = req.getLocation();
|
|
567
|
+
label = `${lat}, ${long}`;
|
|
568
|
+
} else if (isAttachment) {
|
|
569
|
+
actionCategory = TrackingCategory.ATTACHMENT;
|
|
570
|
+
label = req.attachment(0).type;
|
|
571
|
+
} else if (isText) {
|
|
572
|
+
actionCategory = TrackingCategory.TEXT;
|
|
573
|
+
label = text;
|
|
574
|
+
} else if (isQuickReply) {
|
|
575
|
+
actionCategory = TrackingCategory.QUICK_REPLY;
|
|
576
|
+
label = text;
|
|
577
|
+
} else if (req.isOptin()) {
|
|
578
|
+
actionCategory = TrackingCategory.OPT_IN;
|
|
579
|
+
} else if (req.isReferral()) {
|
|
580
|
+
actionCategory = TrackingCategory.REFERRAL;
|
|
581
|
+
} else if (isPostback) {
|
|
582
|
+
actionCategory = TrackingCategory.POSTBACK_BUTTON;
|
|
583
|
+
label = req.event.postback.title || (useExtendedScalars ? null : '(unknown)');
|
|
584
|
+
} else {
|
|
585
|
+
actionCategory = TrackingCategory.OTHER;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
trackEvents.push({
|
|
589
|
+
...(analyticsStorage.hasExtendedEvents ? actionMeta : {}),
|
|
590
|
+
type: TrackingType.CONVERSATION_EVENT,
|
|
591
|
+
lastAction,
|
|
592
|
+
category: asCategory(actionCategory),
|
|
593
|
+
action,
|
|
594
|
+
label,
|
|
595
|
+
value,
|
|
596
|
+
pageCategory,
|
|
597
|
+
nonInteractive,
|
|
598
|
+
...langsExtension
|
|
599
|
+
});
|
|
600
|
+
|
|
602
601
|
await Promise.all([
|
|
603
602
|
analyticsStorage.storeEvents(
|
|
604
603
|
pageId,
|