I have a landing page with several products, with their own url per product. I want to transfer the tracking from the landing URL to the products URL, so I'm using this script:
<script>
var params = $.param(getUrlVars());
$("a").attr('href', function(i, h) {
return h + (h.indexOf('?') != -1 ? "&" + params : "?" + params);
});
</script>
It's working as expected, so from the URL
I get the product URL
I want to add to the parameter "affiliate=XXX"
Can please someone tell me how can I do it?