“mobile”/ banners
Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

How to pass traffic source tokens to redirect landing page

Discussion in 'General Affiliate Marketing Forum' started by guyver888, Aug 3, 2015.

  1. guyver888

    guyver888 Affiliate affiliate


    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 meta refresh URL redirection -->
    <meta http-equiv="refresh"
    content="0; url=http://track.mydomain.com/xxxxxxxxx...ampaign_id}&category={category}&subid={subid}">


    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.

  2. newbidder
  3. crysper

    crysper Moderator moderator Service Manager affiliate

    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:

    var redirect_camp_link="your_link";
        var querystring=window.location.search;
        function removePar(name,qString){
            el=decodeURI((RegExp(name + '=' + '(.+?)(&|$)').exec(qString)||[,null])[0] ||'' );
            return new_st;
        history.replaceState(null, document.title, location.pathname +querystring);
        history.pushState(null, document.title, location.pathname+querystring);
        window.addEventListener("popstate", function() {      
        }, 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.
    guyver888 likes this.
  4. guyver888

    guyver888 Affiliate affiliate

    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?
  5. crysper

    crysper Moderator moderator Service Manager affiliate

    When you paste the original campaign link on the web browser, do you see the tokens changed on the url bar?
  6. guyver888

    guyver888 Affiliate affiliate

    SO when I paste my back button voluum URL I get this on back.html landing page.


    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...
  7. crysper

    crysper Moderator moderator Service Manager affiliate

    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.
    guyver888 likes this.

Top Resources