by orisin
8 replies
It took me a while, but I was finally able to learn how to prepop an offer with an email. Josh todd from getads was kind enough to guide me through the process. so basically you do this with 3 files. your landing page inbound.php and outbound.php
I used aweber and prosper.

In Prosper I set the link to the campaign as http://www.mydomain.com/out.php?SID=[[sid]]

On my landing page I paste in the Aweber form code and set the thank you page to http://www.mydomain.com/in.php

In Aweber make sure to select the "Forward subscriber information to your thank you page" under advanced options.

Here is the code:

in.php

<?php

// This line grabs the email entered in the previous page and stores it in a cookie.
// You need to replace the last part which says '.yourdomain.com' to your actual domain
setcookie("email", $_GET['email'], time() + (60*60*24*30), '/', '.mydomain.com');


// You need to insert the Prosper Landing Page Redirect PHP Code here


// ------------------------------
-------------------------------------
//
// Tracking202 PHP Redirection, created on Mon Sep, 2010
//
// This PHP code is to be used for the following landing page.
// http://www.mydomain.com/mylp.php
//
// ------------------------------
-------------------------------------

if (isset($_COOKIE['
tracking202outbound'])) {
$tracking202outbound = $_COOKIE['tracking202outbound'
];
} else {
$tracking202outbound = 'http://mydomain.com/tracking202/redirect/lp.php?lpip=645&pci='.$_COOKIE['tracking202pci'];
}

header('location: '.$tracking202outbound);

?>

Here is the code for the out.php:

<?php

// This 'if' statement grabs the email from the previous Cookie and stores it in a variable called '$email'
if(isset($_COOKIE['email'])){
$email = $_COOKIE['email'];
}

// Insert your affiliate offer link here in between the single quotes, this is then stored in a variable called '$offerlink'
$offerlink = 'http://myaffiliatelinkcode.com/click...ADID=287736&SI D=';

// This Line Gets the SubID from the Prosper Link and stores it in a variable called '$subid'
$subid = $_GET['subid'];

// Replace the code between the single quotes with the relevant email code from your network, this is then stored in a variable called '$mailtoken'
$mailtoken = '&Email=';

// This line of code puts the affiliate link back together with the SubID and Email and stores it in a variable called '$redirectlink'
$redirectlink = $offerlink.$subid.$mailtoken.$
email;

// This line of code redirects the page to the link stored in the variable '$redirectlink'
header("Location: $redirectlink");
?>

The actual affiliate link goes into the out.php file and mydomain.com/out.php?SID=[[sid]] goes into prosper

With this setup the landing page records the visit and assigns a SID, and submits data to aweber. Email and SID come back from aweber, script pulls sid from and email from a cookie and it formats the link for prepoping the offer.

The only thing I still struggle with is
tracking the converting keywords, since the last link is to the offer and on the outbound.php is the affiliate link from the network. I tried adding the keyword varaible as the subid but it still didn't work

Anyway I hope this will help for some of you who are trying to figure out how to prepop an offer, and if anyone know how to track converting keywords/url's with this setup properly please let me know

Cheers
#cpa #prepop

Trending Topics