Creating a Universal Mobile CPA Campaign Lander

Literally speaking, every campaign you run need not have a seperate landing page, and you can learn some programming and test multivariates using a single landing page.
Today I’m going to show you how to program a single landing page, and with simple tricks you can make it accessible and applicable to multiple countries.
I have always been searching new things to learn, and this was the one small trick I learned while running an App Install Offer for around 60-70 countries.
I needed atleast 45 new landing pages to be created for that campaign and I was thinking of generating all my pages using a program, and then it flashed, why not let the users browser handle it instead of me generating or redirecting to lot of pages.

The method is very simple, the only pre-requisite is to create a translation data ready and use it in the page.

Create the HTML page that you are going to use for the campaign as landing page in english.

Create spans across all the text fields you want in different languages as below.

<span id=”text1″>Your WhatsApp has expired!</span>
<span id=”text2″>Please update WhatsApp now.</span>
<a class=”myButton” href=”‘+offerlink+'”><span id=”text3″>Update</span></a>

Then Create a javascript file lang.js in the subfolder of your choice with few functions and text as in the below block

var translation = {
source: {
text1: “Your WhatsApp has expired!”,
text2: “Please update WhatsApp now.”,
text3: “Update”
},
en: {
text1: “Your WhatsApp has expired!”,
text2: “Please update WhatsApp now.”,
text3: “Update”
},
es: {
text1: “Su WhatsApp ha expirado!”,
text2: “Por favor actualiza WhatsApp ahora.”,
text3: “Actualizar”
},
de: {
text1: “Dein WhatsApp ist nicht mehr aktuell!”,
text2: “Bitte update WhatsApp jetzt.”,
text3: “Update”
}
};
function replace_text(lang, text)
{
x = document.getElementById(text); //Find the element with id=”demo”
x.innerHTML = translation[lang][text]; //Change the HTML content
}

function translate()
{
var detected_language = navigator.language;
if (detected_language.length > 2) {detected_language = detected_language[0] + detected_language[1];};

for (x in translation[“source”]) {
replace_text(detected_language, x);
}

}

Thats it, include this file in the html page with the code block as shown below.

//Just before head

//On Body tag add like this
<body onload=”translate()”>