Home > Paid Traffic Sources > Mobile

Need Help with Code: Call Out Mobile Users (3)


07-04-2014 05:48 AM #1 gaultsyndicate (Member)
Need Help with Code: Call Out Mobile Users

Hey guys, I got this code from Voluum for URL Parameters. I've been adding it to my landing page as is, but it doesn't seem to be working. Is there something I need to change/edit with the code? any help is much appreciated, thanks guys


<html>
<head>
<script>
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
);
}
</script>
</head>

<body>
Hello <script>document.write(getURLParameter('model')) </script> user, you just won!
</body>

</html>


07-05-2014 01:46 AM #2 zeno (Administrator)

Voluum doesn't automatically pass model info into the URL but the tokens are available in the lander setup config.

So, find your lander in Voluum > edit > add ?model={model} to the URL, and continue to add other tokens as needed, e.g. ?model={model}&device={device}&os={os}

Looking at that code, in the getURLParameter part, it gets whatever value is after the query string, i.e. if you have ('model') it sees this in the address bar

...landerURL.com/mylander.html?model=Dekstop User&OS=Windows...,

It finds model in blue and extracts the value in bold and prints it out.


07-05-2014 07:07 PM #3 gaultsyndicate (Member)

Did exactly what you suggested and it seems to be working now.

Thanks again this will come in handy!


Home > Paid Traffic Sources > Mobile