A customer of mine wants to build a web message in a script that they embed in their website by defining customAttributes in the following format. The variables (url/title/bot/areaName/shopName) are assigned the text information required when sending a web message.
Isn't there a way to calculate the size of data sent as customAttributes? No error is displayed on the screen even if the 2KB limit is exceeded, so I don't know that the transmission failed. So I want to check if it exceeds 2KB before sending.
As part of the inbound message logic there is a text encoder used to determine if the 2kb limit is exceeded. If it is, you will not see the message as sent or appearing in Messenger. As a rule of thumb, 2,000 characters will roughly equal 2kb, though there could be some slight variation.
Thank you for your reply again.
Is there a way to catch the error in my code if the message could not be sent due to the 2KB limit of customAttributes?
The following page describes how to debug by logging, but I don't know how to determine an error immediately after a transmission failure. https://developer.genesys.cloud/commdigital/digital/webmessaging/messengersdk/genesysgf
We've made a few minor changes in this area. In cases where customAttributes are 2048 bytes or less, the message will send through successfully. If denied due to exceeding 2048 bytes, there will be a websocket error. This should help solve your issue!