@developer.notchatbot/webchat 1.4.7 → 1.5.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/README.md +9 -2
- package/dist/webchat-bundle.min.js +261 -261
- package/dist/webchat-bundle.min.umd.cjs +14 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -386,6 +386,11 @@ We emit **custom browser events** so you can capture interactions and feed them
|
|
|
386
386
|
| WebChat | `notchatbot-webchat-closed` | The floating chat is closed | `{ conversationId }` |
|
|
387
387
|
| WebChat | `notchatbot-webchat-message-sent` | The user sends one or more messages | `{ messages: Message[] }` |
|
|
388
388
|
| WebChat | `notchatbot-webchat-message-received` | A message is received from the server | `{ message: Message, role: 'assistant' \| 'employee' }` |
|
|
389
|
+
| WebChat | `notchatbot-webchat-button-click` | The round chat widget activator button is clicked | N/A |
|
|
390
|
+
| WebChat | `notchatbot-chatbubble-popover-click` | The initial presentation chat bubble is clicked | N/A |
|
|
391
|
+
| WebChat | `notchatbot-webchat-menu-whatsapp-click` | The WhatsApp button inside the WebChat multi-option menu is clicked | N/A |
|
|
392
|
+
| WebChat | `notchatbot-webchat-menu-webchat-click` | The standard Webchat button inside the multi-option menu is clicked | N/A |
|
|
393
|
+
| WhatsApp | `notchatbot-whatsapp-button-click` | The standalone WhatsApp widget is clicked | N/A |
|
|
389
394
|
| EmbedChat | `notchatbot-embedchat-message-sent` | The user sends a message | `{ message: Message }` |
|
|
390
395
|
| EmbedChat | `notchatbot-embedchat-message-received` | A message is received | `{ message: Message, role: 'assistant' \| 'employee' }` |
|
|
391
396
|
|
|
@@ -403,7 +408,9 @@ window.addEventListener('notchatbot-webchat-message-received', e => {
|
|
|
403
408
|
```
|
|
404
409
|
|
|
405
410
|
#### Google Tag Manager / Google Analytics (GA4)
|
|
406
|
-
|
|
411
|
+
**NEW:** All the events listed above are automatically pushed to the **dataLayer** simultaneously, alongside the window events! This means you can just create a trigger in GTM for `notchatbot-webchat-message-sent` or `notchatbot-whatsapp-button-click` right out of the box, without writing manual JS event listeners.
|
|
412
|
+
|
|
413
|
+
If you prefer firing custom data structures or if you need the message contents cleanly mapped, you can still listen to the `window` events and push to dataLayer manually:
|
|
407
414
|
```js
|
|
408
415
|
window.addEventListener('notchatbot-webchat-message-sent', e => {
|
|
409
416
|
window.dataLayer = window.dataLayer || [];
|
|
@@ -414,7 +421,7 @@ window.addEventListener('notchatbot-webchat-message-sent', e => {
|
|
|
414
421
|
});
|
|
415
422
|
});
|
|
416
423
|
```
|
|
417
|
-
Then in GTM, add a **Custom Event** trigger called `webchat_message_sent` and link it to a GA4 event tag.
|
|
424
|
+
Then in GTM, add a **Custom Event** trigger called `webchat_message_sent` (or `notchatbot-webchat-message-sent` natively) and link it to a GA4 event tag.
|
|
418
425
|
|
|
419
426
|
#### Meta / Facebook Pixel
|
|
420
427
|
```js
|