wingbot 3.61.3 → 3.61.5-alpha.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.61.3",
3
+ "version": "3.61.5-alpha.1",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -81,7 +81,7 @@ async function trackingEvent (req, res) {
81
81
  gaApiSecret
82
82
  } = req.configuration;
83
83
 
84
- if (clientId && gaMeasurementId && gaApiSecret) {
84
+ if (type === 'report' && clientId && gaMeasurementId && gaApiSecret) {
85
85
 
86
86
  const ev = transformEvent(c, a, l, v, req, res);
87
87
 
@@ -105,11 +105,19 @@ async function trackingEvent (req, res) {
105
105
  };
106
106
 
107
107
  try {
108
- await fetch(`https://www.google-analytics.com/mp/collect?api_secret=${encodeURIComponent(gaApiSecret)}&measurement_id=${encodeURIComponent(gaMeasurementId)}`, params);
108
+ res.typingOn();
109
+ const result = await fetch(`https://www.google-analytics.com/mp/collect?api_secret=${encodeURIComponent(gaApiSecret)}&measurement_id=${encodeURIComponent(gaMeasurementId)}`, params);
110
+
111
+ // eslint-disable-next-line no-console
112
+ console.log('GA RESPONSE', result.status, body);
113
+
109
114
  } catch (e) {
110
115
  // eslint-disable-next-line no-console
111
116
  console.error('GA FAILED', e, body);
112
117
  }
118
+ } else if (clientId) {
119
+ // eslint-disable-next-line no-console
120
+ console.error('GA MISSING', req.configuration);
113
121
  }
114
122
 
115
123
  res.trackEvent(type || 'report', c, a, l, v);
@@ -141,7 +141,7 @@
141
141
  {
142
142
  "id": "ai.wingbot.trackingEvent",
143
143
  "name": "Report tracking event",
144
- "description": "You can use handlebars templates here",
144
+ "description": "You can use handlebars templates here\nFrontend GA categories: generate_lead,view_item,purchase,tutorial_begin,tutorial_complete,sign_up,share\nFrontend GA action: item category\nFrontend GA label: currency (USD)",
145
145
  "availableSince": 3.13,
146
146
  "editable": false,
147
147
  "isFactory": false,
@@ -162,7 +162,7 @@
162
162
  {
163
163
  "name": "category",
164
164
  "type": "text",
165
- "label": "Event category (generate_lead,view_item,purchase,tutorial_begin,tutorial_complete,sign_up,share)"
165
+ "label": "Event category"
166
166
  },
167
167
  {
168
168
  "name": "action",