Reinitialize zendesk script with iframe
Publicado 03 abr 2024
I use the standard zendesk script when initializing my application. Everything works fine. But I have several different chat rooms and at a certain action for example the user has logged into my application, I should change {my_key} and a new zendesk widget will load. But this is not happening. When I change the conditions, {my_key} is inserted correctly, but the widget itself does not change.
I tried to delete the script and div element in which the Iframe zendesk. Tried to disable cookies for zendesk, with popposchuyu window.zE('messenger:set', 'cookies', false); and then re-enable.
In general, tell me how to dynamically change the key in script tag src, load a new chat?
<!-- Start of priokunden Zendesk Widget script -->
<script id="ze-snippet" src="https://static.zdassets.com/ekr/snippet.js?key={my_key}"> </script>
<!-- End of priokunden Zendesk Widget ->
0
1 comentario
Andrey Sarapulov
The following did the trick for me.
This is NOT production ready code. It is for demo purposes only. Please make it look awesome and test carefully before using in production.
0
Iniciar sesión para dejar un comentario.