Global Variables in the Site Builder
Global Variables work throughout the platform in flows, in the back end, and in the Custom Code areas of "Site Settings" and "Page Settings".
We can quickly and easily use them in the page builder too with a small code snippet.
In Page Setting > Custom Code > Body End, copy the code below.
<body onload="myGVFunction()">
<script>
function myGVFunction() {
document.getElementById("i7ww9").innerHTML = "Hi, this text is dynamically inserted > {$gv.gv_demo_text}"
;}
</script>
Inside the script, at the end of the long line, you can see "Hi, this text is...." etc.
Inside the " " you can see {$gv.gv_demo_text}, this is a Global Variable.
To use a different global variable on the page, just insert the global variable in between the "", as well as any other text you require.
Then in the page builder, you need to add a text element, grab the id of the text element and switch it with "i7ww9".