Hi all,
Would greatly appreciate some tips on how to go about the following.
Situation
We need to personalize message tone of voice (formal or informal) based on some parameters of our website’s data layer. Therefore, I need to dynamically change the Q_Language value. I can do this in the Embedded Data section of the action set in my intercept by selecting Value: Value from JavaScript and inserting the expression: (datalayer.tone_of_voice === "informal") ? "nl-in" : "nl";
This works ok, but since we have multiple intercepts containing multiple action sets, it would be easier for me to centralize this logic somewhere.
Question
Is it possible to centralized this logic somewhere so that it is valid for all intercepts inside a web projects?
I was thinking of putting it on the theme level, inside the header. But I fail to understand how you can change the language with JavaScript from there. I know of setJSEmbeddedData function, but that is for the SurveyEngine, so question level JS, which does not seem to help me in my scenario.
Thank you!