Hi @SanfordWhiteman, I’m currently working with UTM parameters and assigning values using global variables in email editor 2.0. However, the client reported an issue where this approach doesn’t work when dynamic content (segmentation) is used. After doing some research and testing, I found that global variables are indeed not compatible with dynamic content.
Could you please suggest a workaround or an alternative approach to address this issue?
Solved! Go to Solution.
To use a global ${mktoVariable}
in Dynamic Content:
${mktoVariable}
in-between 2 Velocity {{my.tokens}} with
#define($mktoVariable_VTL)
#end
${mktoVariable_VTL}
This is a very advanced use of Velocity in Marketo. Be sure you understand how Velocity scope & order-of-operations work before supporting it in a production environment.
To use a global ${mktoVariable}
in Dynamic Content:
${mktoVariable}
in-between 2 Velocity {{my.tokens}} with
#define($mktoVariable_VTL)
#end
${mktoVariable_VTL}
This is a very advanced use of Velocity in Marketo. Be sure you understand how Velocity scope & order-of-operations work before supporting it in a production environment.
Hi @SanfordWhiteman, how we will ge the value of modular email global variables in velocity token?
What do you mean by “modular email global”? A global variable and a module-scoped variable are different.
Hi @SanfordWhiteman, I am asking about these values that defined in global variable of email editr 2.0.
These variables are not working with segmentation. So I did research but it is not supporting. I need a workaround if there is any.
But I described how to do that above?
Hi @SanfordWhiteman, I was applying the same method and added all the tokens in email. Iit is showing the variable as it is. No value is coming.
Would need a detailed set of screenshots showing what you attempted.
Hi @SanfordWhiteman, here is the screenshot of the velocity script tokens:
Added like this in Editor
Showing this output
I am not so proficient in Velocity script and I took help from chatgpt to implement the same.
I am not so proficient in Velocity script and I took help from chatgpt to implement the same.
Well, that’s not going to work. ChatGPT is giving you broken code (as it usually does for Velocity tokens, not to mention infinite other areas). That’s why I mentioned you really have to understand Velocity to support this setup.
Again, the requirement is to output the ${mktoVariable} in-between Velocity {{my.tokens}}. It doesn’t go inside any Velocity token. If this still isn’t making sense it’s likely that you shouldn’t be putting this into prod.