Unfortunately, it’s not possible to set the group ID dynamically. The group is set once the widget is loaded and changing the group requires reloading the entire chat widget. What our tech support recommends, given it works with your implementation, is to use the group-selection element in the pre-chat survey, as that’s the only option to change the group without reloading the chat widget.
Could you let me know more about your use case?
I’m thinking - if purpose of dynamically changing groups is routing to agents specifically,
perhaps a back-end solution would be easier to implement.
For example a bot that receives all chats first and then transfers each chat accordingly to different groups based on data of your choice?