Dynamic international unsubscribe page

Stephen_Jeong1
Level 3

Dynamic international unsubscribe page

Hello,

I am trying to edit my current unsubscribe page so that if people from China get to it, all the content will show up in chinese or if people in Japan go to it, everything will be in Japanese.

I know how to change the content itself and make it dynamic based on country but I'm having difficulty trying to figure out how to make the button text dynamic.

Is there a simple way to make that dynamic? I imagine it'll take some html/css code to make it happen.

9 REPLIES 9
Casey_Grimes
Level 10

Re: Dynamic international unsubscribe page

Hi Stephen,

You have a few options:

- You could have different forms display based on the country of the user using segments (the most user-friendly option)

- You could set a language variable in JavaScript on your dynamic text, have a window.onload check for the variable, and use innerHTML to swap the button text (the technical but lazy option)

- You could pass the language as a hidden URL parameter in the unsubscribe link, parse the value using Forms 2.0, and use innerHTML to swap the button text (the technically correct solution)

Also, out of curiosity: for Japanese, are you using メーリングリストの登録解除 or アンサブスクライブ?

Stephen_Jeong1
Level 3

Re: Dynamic international unsubscribe page

Thanks for the suggestions! I did not start translating the copy yet so I don't know which one we will be using but when I find out I'll let you know!

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic international unsubscribe page

Stephen, further to Courtney's third point, you should check out these posts and my related code:

Re: How do I update the submit button and error message to reflect local language (i.e French)

Re: Marketo Dynamic Form Field Labels - Multiple Languages

I've just demoed the language-switching code for the NYC MUG tonight so feel free to ask any questions.

Stephen_Jeong1
Level 3

Re: Dynamic international unsubscribe page

Thanks that's exactly what I was looking for!

I'm looking at the code you used and I put that in my form but I'm not seeing it dynamically changing to the other language. If I wanted to change the code to say that if a lead's country value is "Japan" then make the submit button say "アンサブスクライブ" ,how would I do that?

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic international unsubscribe page

Here's the dictionary DIV with your Japanese submit text:

pastedImage_2.png

And here's how it looks on the form: http://codepen.io/figureone/pen/mJWgjE?editors=001&lang=jp-JP

Stephen_Jeong1
Level 3

Re: Dynamic international unsubscribe page

Thank you for the updated code Sanford.

I'm not sure what I'm doing wrong but when I put that code in to my form using the rich text field, it just shows up as text.

Here's the code I put in:

<div id="translateMap">

{

"en-US": {

"LastName": {

"label":"Surname", "validation":"Make sure that's your real last name.", "submit":"Go"

}

}, 

"fr-FR":{

"FirstName":{

"label": "Pr&eacute;nom", "placeholder": "Victor", "submit":"Envoi"

}

}, 

"jp-JP": {

"FirstName":{ "submit":"アンサブスクライブ"

}

}

}

</div>

And here's what it looks like on my LP:

2015-09-02_0929 - stephen.jeong's library

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic international unsubscribe page

You put it in the HTML source view, right?

And you probably didn't include this CSS:

/* hide the last rich text div used to pass JSON translate map */

.mktoFormRow:not([data-wrapper-for]) { display: none; }

#translateMap { display: none; }

What's the actual URL you're working on?

Stephen_Jeong1
Level 3

Re: Dynamic international unsubscribe page

thanks! that did the trick!

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic international unsubscribe page

Great! Can you 'Mark as Correct'?