How to make a <script> with dynamic "src" parameter?

Hi everyone!

I have a live chat script on a website, similar to Intercom.
Currenly it is simple tag, like <script src="//" async></script>

Now I want to use different scripts in different situations (for example, depending on the user’s selected language).
So it has to be dynamic data binding, like <script dmx-bind:src="" async></script>

But I quickly recognized that dmx-bind:src doesn’t work here. I read some forum threads, including this, so I’ve got a better understanding, why exactly dmx-bind:src doesn’t work.
If I understand, there is some solution to this, but I can’t find a clear instruction.

Seems like I have to prepare a script and run it via “Run JavaScript” step in “Page flow” or via Static Event after page or data loaded.
But specific steps are a bit unclear for me. Because of the lack of JavaScript knowledge and how it works in Wappler.

Can someone please give me a detailed instructions, how to solve this?

Community Page
Last updated: