The Most Active and Friendliest
Affiliate Marketing Community Online!

“Adavice”/  “1Win

How to pass traffic source tokens to redirect landing page

guyver888

New Member
Hi,

My coding knowledge is limited. I am using this back button redirect script:

<script type="text/javascript">function appendqs(t,n){var e=t&&-1!==t.indexOf("?"),o="";return n&&(o=e?"&":"?",t+=o+n),t}var pageInfo={title:document.title,url:location.href},backPageInfo={title:null,url:appendqs("back.html",location.search.substring(1))};window.history.pushState(backPageInfo,null,backPageInfo.url),window.history.pushState(pageInfo,pageInfo.title,pageInfo.url),window.addEventListener("popstate",function(){document.URL.indexOf("back.html")>=0&&(document.location.href=document.location)});</script>

My back.html file is a simple redirect to a separate voluum campaign to track back button redirects:

<!DOCTYPE html>
<html>
<head>
<!-- HTML meta refresh URL redirection -->
<meta http-equiv="refresh"
content="0; url=http://track.mydomain.com/xxxxxxxxx...ampaign_id}&category={category}&subid={subid}">
</head>
<body>

</body>
</html>

The issue I'm having is none of my traffic source tokens are being passed onto my back button redirect Voluum campaign. Is there a solution to this or am I missing something?

Any help is appreciated.

Thanks
 
To make it work you need to redirect to a new campaign from voluum and copy the tokens which are already passed by the script to the back page.

However, try a quicker solution:

Code:
var redirect_camp_link="your_link";
    var querystring=window.location.search;
    function removePar(name,qString){
        el=decodeURI((RegExp(name + '=' + '(.+?)(&|$)').exec(qString)||[,null])[0] ||'' );
        new_st=qString.replace(el,'');
        return new_st;
    }
    history.replaceState(null, document.title, location.pathname +querystring);
    history.pushState(null, document.title, location.pathname+querystring);
    window.addEventListener("popstate", function() {      
            location.replace(redirect_camp_link+removePar('voluumdata',querystring))      
    }, false);


Make a voluum campaign with back.html as lander(you can even try multiple back button pages this way) and instead redirecting to back.html, use this script in the main page to redirect to the back button voluum campaign. In the "your_link" variable put the voluum campaign url you get from the edit campaign form in voluum.
 
In the "your_link" variable put the voluum campaign url you get from the edit campaign form in voluum.
Thanks Crysper. The redirect to my back button voluum campaign works fine but my redirect voluum campaign is still not providing the traffic source data but instead showing me the tokens such as {source_name}, {creative_id} etc. I put that script you provided just before </HEAD> replacing my original back button script.

So I am able to view some of the data but not the traffic source tokens... Am I missing something?
 
When you paste the original campaign link on the web browser, do you see the tokens changed on the url bar?
SO when I paste my back button voluum URL I get this on back.html landing page.

mydomain.com/back.html?brand=Opera&isp=Sky%20Broadband&voluumdata=vid..00000003-bc6a-4d3e-8000-000000000000__vpid..b1a94000-39f8-11e5-8550-343a4aed63a3__caid..7d8d8c38-e37f-4262-b851-9456fdace17a__rt..R__lid..11fe9a5d-97d8-4cd5-8336-dd6f07dc812d__oid1..83c09d73-44eb-48a3-a6fb-2873daefd237__var1..%7Bcreative%5C_%5Cid%7D__var2..%7Bpublisher%5C_%5Cname%7D__var3..%7Bsource%5C_%5Cname%7D__var4..%7Bos%5C_%5Cversion%7D__var5..%7Bexchange%7D__var6..%7Bdevice%5C_%5Cmodel%7D__var7..%7Bdevice%5C_%5Cvendor%7D__var8..%7Bcarrier%7D__var9..%7Bcampaign%5C_%5Cid%7D__var10..%7Bcategory%7D__rd..&creative_id={creative_id}&pub_name={publisher_name}&source={source_name}&os_version={os_version}&exchange={exchange}&device_model={device_model}&device_vendor={device_vendor}&carrier={carrier}&campaign_id={campaign_id}&category={category}&subid={subid}

I'm assuming these won't change because they're coming from my traffic source so by me pasting the link on web browser then it will not work. But I tested it again my traffic source and still getting {creative_id} etc rather than data...
 
Some tags are filled and some not. The tags that voluum change should also appear on the second campaign using the script i gave you(that you should check). For the tags that don't appear on the first page, it won't appear in the seconds one(back) because the transfer is done by copying. The other tags that are not changed are related to your voluum setup.
 
MI
Back