SOLVED

Re: Using a Token on a Landing page

Go to solution
Anonymous
Not applicable

Using a Token on a Landing page

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? 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Using a Token on a Landing page

Yes, anything Marketo's Velocity environment can do can be replicated in JS (and more, of course).

View solution in original post

10 REPLIES 10
SanfordWhiteman
Level 10 - Community Moderator

Re: Using a Token on a Landing page

Yes, anything Marketo's Velocity environment can do can be replicated in JS (and more, of course).

Anonymous
Not applicable

Re: Using a Token on a Landing page

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!

Anonymous
Not applicable

Re: Using a Token on a Landing page

so my solution then would be to customize the javascript.  I'm no js pro so it makes it a bit more difficult

SanfordWhiteman
Level 10 - Community Moderator

Re: Using a Token on a Landing page

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.

Anonymous
Not applicable

Re: Using a Token on a Landing page

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Using a Token on a Landing page

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>

Justin_Cooperm2
Level 10

Re: Using a Token on a Landing page

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: Using a Token on a Landing page

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.

Anonymous
Not applicable

Re: Using a Token on a Landing page

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.