Hello,
When I see a device type script on a lander for a phone, do I need to pass device type in the actual lander URL, or can the script still access that information the same way the tracker accesses that info without it all being in the URL string (using volumm).
For example:
<script>document.write(getURLParameter("brand") + (" ") + getURLParameter("model"))</script>S
Thanks
I'm a little confused as to your question, but here's my best shot:
Regardless of which getURLParameter script you use, those parameters need to be IN THE URL (at least on page load) in order to be plucked out with that method call. In
When your camp link is clicked,
Now a few tips as far as scripts go. I've figured out a pretty slick way of passing the tokens, but then REMOVING them with JS after page load, so they don't ugly up the url for your visitor. You can still access in your scripts. This works in conjunction with my 'back' script. You can modify the back script to still act normally, if you'd like, to redirect to your click URL, or send it to a smart link...up to you.
First the backscript:
window.history.replaceState(null, '', window.location.pathname + "#!/back");
window.history.pushState(null, '', window.location.pathname);
window.addEventListener("popstate", function() {
if (location.hash === "#!/back") {
setTimeout(function() {
location.replace("**BACKREDIRECT**");
}, 0);
}
}, false);

function getURLParameter(name) {
var name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
var results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
var city = (cityParam = getURLParameter('city')) ? cityParam : 'Manila';
var country = (countryParam = getURLParameter('country')) ? countryParam : 'Philippines';
var brand = (brandParam = getURLParameter('brand')) ? brandParam : '';
var model = (modelParam = getURLParameter('model')) ? modelParam : 'mobile device';
var carrier = (carrierParam = getURLParameter('carrier')) ? carrierParam : 'mobile device';
<script>document.write(brand+' '+model)</script>
To answer the real question (lol, I went on a tangent...hopefully it helps someone; and please test this stuff out -- dont just blindly trust me
), yes, you have to pass them in Voluum first though
Wow Chris thanks for going to such lengths to help out a fellow member!
Thank you very much!
@sharingan_eyes: Passing parameters via lander url tokens as Chris has laid out in detail would be the easiest way. The alternative would be to use extra scripts and databases. For example this script for detecting mobile devices:
http://mobiledetect.net/
I've never used this or similar scripts so don't know if it works, just saying there are solutions out there you can test.
For stuff like country and carrier, you'd need to tap into an IP database such as Maxmind. That would mean extra costs and trouble. Is there a particular reason why you're wanting to avoid passing parameters via the url?
Amy