Passing Variables Through Prosper 202 Mod

The Issue:

A new campaign I am about to run requires me to pass a zip code as a get variable in the url. For example:

http://offerpage.com?id=666&zip=12345

This is also known as a pre-pop, as in “pre-populating” an offer.

The Problem:

So my landing page is all set up.  I have a form on there that let’s the user enter his zip code and I have my Prosper202 javascript tracking code in place.   Everything’s great until I have to actually pass that zip code through Prosper and then to my offer page.

When you “Get LP Code” in Prosper202, you get outbound links like this:

$tracking202outbound = ‘http://yourProsperDomain/tracking202/redirect/off.php?acip=123&pci=’.$_COOKIE[‘tracking202pci’];

Even if you modify this URL, any additional variables you add will get ignored and lost during the redirection process.

The Solution:

There are a few ways to fix this, one of them is by using cookies.  I haven’t test this solution here, but it looks like it would work. However, it would not allow you to use Prosper202’s cloaking feature. That kind of sucks 🙁

My fix is a hack.  You will need to edit one file in your Prosper202 install.  But once you’ve done the mod, it will allow you to pass any variables you want in a simple, elegant way.  No need for multiple files, cookies, or other bullshit that I will never remember to do. 😉

The Mod:

Edit: tracking202/redirect/off.php

Change 1/3:
Add the following code directly below the open php tag, like so:

1
2
3
4
5
6
7
8
9
10
11
12
<? 
/* Get Variable Pass-thru Mod, by Mark -- http://ctrtard.com -- added 8-3-2010
This mod will allow you to pass additional variables to the P202 redirect. E.g.
$tracking202outbound = 'http://your202.com/tracking202/redirect/off.php?acip=123&pci='.$_COOKIE['tracking202pci'] . '&zip=10010';
*/
foreach($_GET as $key => $value) {
    if ($key !== "acip" AND $key !== "pci")
    $stack .= "&$key=" . urlencode($value);
}
/* End Get Variable Pass-thru Mod */
 
#only allow numeric acip's

Change 2/3:

Add the following code on line 98. Directly below the line that reads: “$redirect_site_url = replaceTrackerPlaceholders($redirect_site_url,$click_id);”

96
97
98
99
100
    $redirect_site_url = replaceTrackerPlaceholders($redirect_site_url,$click_id);
 
    /* Get Variable Pass-thru Mod */
    $redirect_site_url .= $stack;
    /* End Variable Pass-thru Mod */

Change 3/3:

Add the following code on line 373. Directly below the comment that reads: “//NOW LETS REDIRECT”

371
372
373
374
375
//NOW LETS REDIRECT  
 
/* Get Variable Pass-thru Mod */
$redirect_site_url .= $stack;
/* End Variable Pass-thru Mod */

Note, line numbers for the off.php file are from Prosper 1.5.1. If you have a different version, the line numbers might be in slightly different places.

Usage:

Once the mod is in place, passing any variable you need to is simple and elegant.  All you need to do is append it.  Here is a chunk of code to show how this can be done. We will pass a zip and color variable:

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$color = "red";
$zip = "12345"; 
 
// paste our outbound link Prosper gave us in "Get LP Code"
$tracking202outbound = 'http://yourProsperDomain/tracking202/redirect/off.php?acip=123&pci='.$_COOKIE['tracking202pci']; 
 
// now let's append our variables
$tracking202outbound .= "&zip=$zip&color=$color";
 
// make a link
echo "<a href=\"$tracking202outbound\">click here</a>";
?>

Assuming our offer link was “http://offerpage.com?id=666”, the user would be redirected to:

http://offerpage.com?id=666&zip=12345&color=red

Yay!

Please comment and ReTweet if you found this useful.

Leave a comment

Leave a Reply to ctrtard Cancel reply.

*

*

CommentLuv badge
Cancel reply

36 Comments

  • What version of Prosper are you using?

    • 1.5.1

      • Oh ok you are doing landing pages within Prosper. I have never done that and I was looking at your code and was being like ‘wtf is that’ lol. This hax has already got my wheels spinning, thanks for sharing!

  • So you’re saying pre-pop. That’s pretty cool.

    • Yeah, I guess I am saying pre-pop.

      Thanks for reading.

  • Wow! Works great! Will your hack mess up a normal redirect? Or will everything still work the same?

    Thanks!!
    Josh

    • No, the changes won’t mess up anything.

      Thanks for reading and commenting.

  • have you found a way to do this with a direct linked campaign?

    • @Wes It didn’t even occur to me to make a mod for DL. But yes, it would be easy.

      The most elegant solution would be to mod tracking202/redirect/dl.php so it works the same way as this mod does.

      I’m sure a bunch of other people would find it useful too, so I’ll make the mod in the next couple of days and post it here.

      Thanks for reading and commenting.

  • gweedsishere

    Has anyone been able to get this to work?

    • I’m guessing “Josh Wexelbaum: Wow! Works great!” got it to work.

      It also, of course, works great for me.

      • gweedsishere

        Looks like I spoke too soon. Got it to work.

        Thanks.

  • chris

    I tried the “Passing Variables Through Prosper 202 Mod” but it doesn’t seem to work for me.

    what i have notice is that in your example, your outbound link ends in “tracking202/redirect/off.php”

    but when i get my outbound link it ends in “/tracking202/redirect/lp.php?”

    can you please help

    • Are you using an Advanced Landing Page? And what version of P202?

      • chris

        I was using simple landing page does it have to be advanced?

        p202 version 1.5.1

  • Sonny

    Great mod, thanks!

    I have one stupid question: with a network that requires the pass parameter as “pass[email]=” I have the following:

    $tracking202outbound .= “&pass[email]=$email”;

    yet nothing passes (I think the [ ] are breaking things yet am not knowledgable enough to even know what this is called in order to google a solution). Is there an easy fix so that I can pre-pop to them?

    Thanks!

  • Thanks for the great workaround! Have you ever got around to making a mod for a direct link?

  • Marty

    Hi Mark, great stuff indeed. I realized that you can pass the value with a specific variable (for example zip=) but what would you do if you want a specific value to be passe in the variable t202kw= ?

    Because I want to pass the variable in the URL and see it in the keyword column in my p202 stats.

    thanks

  • Mike

    Thank you, but If i want to pre pop an email address and not zip what are the variables i need to use?

    • It totally depends on what variables the offer page accepts. You need to contact your AM and ask what variables are available to be pre-popped.

  • Mathias

    It doesen’t seem to register the click through from LP to offer with this method?

  • Are you able to register the clickthrough from LP to offer with this method also? I can’t seem to get it working… Thanks for this great method btw!

    Mathias

    • Yeah it works fine. You must be doing something wrong.

      • Mathias Aarre Mæhlum

        I’ve heard this is probably because of p202’s cloacking?

        Maybe I should invest in SSL for my tracking domain?

        • This works fine with cloaking. But yes, since you can get SSL certs super cheaply, its good to get one for your tracking domain so you can blank referrers.

  • mathdoc

    I know this is an old post, but why not just input your aff link in prosper to include &zip=[[c4]] in the url. That way you can pass the zip in the c4 variable. No hacking necessary.

  • Garrett

    Great mod!

    For Prosper202 version 1.7.2, you need to modify the tracking202/redirect/lp.php page instead of off.php… I spent a few minutes wondering why I couldn’t get it to work, haha.

    Thanks a ton for posting this

    • Glad you liked it. Thanks for letting me know it was useful!

  • James

    I applied this with php5.4 and prosper 1.7.2 but always stuck on off.php

Trackbacks/Pingbacks

[…] banging my head on the wall trying to figure out the tracking. Eventually Google helped me out: Passing Variables Through Prosper 202 Mod | CTRtard.com – Internet Marketing with a Helmet Got the whole process all setup from start to finish and all nicely tracking. Lucas, could I PM […]

Passing Variables Through Prosper 202 Mod [Link] « January 17, 2011

 
 
 

Related posts by category

Related posts by tag