Hey everyone, feels like I'm spending so much time in this part of STM... Anyways, here's what I'm working on right now: passing GET parameters using javascript.
Here's my setup:
Traffic source => www.myurl.com/redirect.php => www.MyTracker.voluumtrk.com => Landing Page => Offer
At the traffic source, my link is www.myurl.com/redirect.php?zoneid=[zoneid] and I want the zone ID to be passed to my tracker so I can cut bad placements.
What I've come up with:
<script>
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
);
}
function goto(){
var url = "http://xxxx.voluumtrk.com/click?zoneid=" + encodeURIComponent(getURLParameter("zoneid"));
window.location.href = url;
}
</script>
Why don't you use the campaign urls generated by
You can define custom variables in voluum and have them all be a part of the campaign url.
The reason why I'm not using the
The variables are set in

But it still doesn't pass 
Hi jelz03,
The script that you have seems to be okay (assuming that later on you're calling the goto() function that you have defined), but the URL that you're constructing is a Click URL - it's the one that you use to redirect from the landing page to the offer.
In the scenario that you have described, you need to pass it to the Campaign URL (the one that redirects to the landing page, looks for example like this: http://xxxxx.voluumtrk.com/b5e8e3bb-...63c745?zoneid=[zoneid] ) - only then we will be able to track that information.
It is possible to append parameters to a Click URL - but it's mostly used when there's an input on the landing page itself, for example when user has to input his email address, and you want to pass it to the affiliate network as a parameter, then you can add it to the click URL by appending /click?email=sample@email.com, and then &email=sample@email.com will be appended to the offer URL.
Kind regards,
Pawel
Hi Pawel,
Indeed it makes a lot of sense to pass the parameter to the tracking url instead of the click url, thanks for pointing it out.
However when I try to pass the parameter to the tracking url I have a double value like
http://xxxxx.voluumtrk.com/b5e8e3bb-...63c745?zoneid=[zoneid]&zoneid=12345
nice post.
Hi,
var url = "http://xxxxx.voluumtrk.com/b5e8e3bb-9eec-4c18-a458-e9243463c745?zoneid=" + encodeURIComponent(getURLParameter("zoneid"));
Thanks Pawel, some stupid mistakes I made prevented from making it work.
It's working now, thanks!