I have a custom email script token that works perfectly in email. Is there a way to translate this type of token to a landing page?
Solved! Go to Solution.
Yes, anything Marketo's Velocity environment can do can be replicated in JS (and more, of course).
Although I suppose Sanford's answer is correct, I still think the answer would be no. Email script tokens don't work on landing pages. Would be great thought if they did!
so my solution then would be to customize the javascript. I'm no js pro so it makes it a bit more difficult
Sean did say "translate," though.
Every Velocity task can be done in JS, but *not* vice versa by a long shot. So I wouldn't be pessimistic about translating in the direction.
Sean, if you post your script and an example of the tokens I'm sure we can find a quick way to do it.
Thanks --
the script for token {{my.agent_signature_name}} is below
#if (${lead.Agent_Disabled_Status} != 1)
#if (!${lead.Agent_Business_Unit.toLowerCase().contains('dfw')} &&
!${lead.Agent_Business_Unit.toLowerCase().contains('rgi')} &&
!${lead.Agent_Business_Unit.toLowerCase().contains('telesales')} &&
!${lead.Agent_Business_Unit.toLowerCase().contains('dialog')}
)
<p style="color: #666; font-family: arial; font-size: 17px; line-height: 135%; font-weight: bold; margin: 0;">
#if (${lead.Agent_Preferred_Name} != '')
${lead.Agent_Preferred_Name} ${lead.Agent_Last_Name}
#else
${lead.Agent_First_Name} ${lead.Agent_Last_Name}
#end
</p>
#end
#end
OK, here's one of many possible JS translations:
<p id="agentName" style="color: #666; font-family: arial; font-size: 17px; line-height: 135%; font-weight: bold; margin: 0;"></p>
<script>
var Lead = {
Agent_Disabled_Status: "{{Lead.Agent_Disabled_Status}}",
Agent_Business_Unit: "{{Lead.Agent_Business_Unit}}",
Agent_Preferred_Name: "{{Lead.Agent_Preferred_Name}}",
Agent_First_Name: "{{Lead.Agent_First_Name}}",
Agent_Last_Name: "{{Lead.Agent_Last_Name}}"
}
if (Lead.Agent_Disabled_Status != 1 && !(Lead.Agent_Business_Unit.match(/dfw|rgi|telesales|dialog/i))) {
document.querySelector('#agentName').innerHTML = (Lead.Agent_Preferred_Name || Lead.Agent_First_Name) + " " + Lead.Agent_Last_Name;
}
</script>
That's kind of true, except you won't have access to custom object fields in the LP, which you would have access to in an Email Script.
You're right, I should have said there are mutually exclusive functionalities on both sides! My bad. I was leaping to the conclusion (luckily accurate) that we were talking about standard tokens.
Thanks so much for the replies. very much appreciated.
This script looks promising and its very awesome of you to help out. JS is on my to-do list to learn more fully. Hopefully this works in testing. I'll update it later.