Hello everyone.
I've got some problems about getURLParameter. First of all,should I add ?brand=Whateverbrand&country_name=Whatevercountry and all of remaining parameters to my landing page URL for replacing it for me with the correct value automatically.And if it was right,is the writing of parameter like parameter=Whatever+the name of parameter.For instance,the parameter is isp so I should add isp=Whateverisp to my landing page URL.
<script>
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
);
}
</script>
</head>
<body>
<div class="q"><div class="b r"><img src="cadeau.png">
<table class="c">
<tbody>
<tr>
<td>Date:</td>
<td><script>document.write(d());</script></td>
</tr>
<tr>
<td><b>User reference:</b></td>
<td>BeQuick-938123-47</td>
</tr>
<tr>
<td><b>Country:</b></td>
<td><script>document.write(getURLParameter("country"));</script>AU</td>
</tr>
</tbody>
</table></div>
<div id="copy">
<h1>Dear <script>document.write(getURLParameter("isp"));</script>Telstra Internet User, Now Is Your Chance To Win $15,000 cash, FREE!</h1>
<p>We want to thank you for being a loyal <script>document.write(getURLParameter("country"));</script>AU<script>document.write(getURLParameter("isp"));</script>Telstra Internet
user! Your IP address <script>document.write(getURLParameter("ip"));</script>144.138.238.128 has been randomly selected to receive <b>FREE $15,000 in cash!</b>.
</p><p>Every month we select a few <script>document.write(getURLParameter("isp"));</script>Telstra Internet users to receive premium gifts from our sponsors. This is our way of thanking and repaying you for choosing <script>document.write(getURLParameter("isp"));</script>Telstra Internet as your preferred service.
No, you add the parameter plus the token from your tracker to the URL.
For example this is how a landing page URL from my tracker would look like
http://mylandingpagedomain.com/index.html?brand={device_brand}&model={device_mode l}&browser={browser_name}&browserversion={browser_ version}&os={os_name}&osversion={os_version}&isp={ isp}&city={city}&ip={ip}
The tracker then recognizes the tokens and replaces them with the appropriate values
Can you try replacing the following script:
<script>
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
);
}
</script>
<script>
function getURLParameter(name) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] === name){return pair[1];}
}
return "";
}
</script>
@j80montes you should keep the parameters appended in your url with the respective tokens as suggested by twinaxe. Those are the parameters that the script will read from and dynamically display the information in your lander.
Sent from my iPhone using STM Forums mobile app
Yes, your landing page URL would look like this.
But you use
Otherwise the tokens won't be interpreted correct.
And yes, you delete the actual values from the code but you keep the JS there so that the values will be inserted dynamically.
About the country token, I can't tell if it works or not in Voluum.
You better check Voluums documentation for it.
About the JS code platinum posted, of course you still need to add the parameters and tokens to the URL, otherwise it won't work because there would be no values to get from the URL.
Thank you again!