Postbacks on Copeac

Status
Not open for further replies.

Mike

New member
Jun 27, 2006
6,777
117
0
51
On the firing line
I'm sure this translates to almost any CPA company using DT, but since Copeac is the only one I've done this with, I'll address it based on that assumption.

First, WTF are postbacks? A postback is a pixel that they fire on their offer when you get a conversion, then it hits a script on your server. There are two $_GET statements that it will send: SID and PID.

The SID is a value that you passed to them in your affiliate URL.

Code:
http://www.cpaclicks.com/secure.asp?e=fdsafdsafdas&d=0&l=0&o=[COLOR=Cyan][B]{SID}[/B][/COLOR]
Where I have {SID} you would put your information, be it an email address, customer's name, whatever. So, if you want to use the email address, the code would look like:

Code:
http://www.cpaclicks.com/secure.asp?e=fdsafdsafdas&d=0&l=0&o=[COLOR=Cyan][B]bobo@bobo.net[/B][/COLOR]
BTW, the above URL's are just examples.

Here's a simple postback script (in PHP):
Code:
<?php

mysql_connect('localhost','user','password');
mysql_select_db('database');

$email = $_GET['SID'];
$program = $_GET['PID'];

$query = "UPDATE table SET conversion=1 WHERE email='$email'";
$query1 = "UPDATE table SET copeac='$program' WHERE email='$email'";

mysql_query($query) or die(mysql_error());
mysql_query($query1) or die(mysql_error());

mysql_close($conn);

?>
Yeah, it's ugly, but it works. What's happening there: when I get the postback, it's being sent to:
Code:
http://www.MySite.tld/postback.php?SID=email@address.tld&PID=2305
I'm catching the email address and updating my database to reflect that a conversion has been made.

There is a catch, you can only have one postback URL per account. If you have multiple sites that use different databases on different sites / servers you'll have to set up multiple accounts with Copeac. This really isn't that big of a deal, just let your account manager know what's going on. Also, you can only pass across one piece of information to them, so you'll need to be able to cross reference your database to piece together the rest. I'm using the email to do that.

The thing that I really like about postbacks is it makes it very easy for me to see what traffic is converting. That way, if I'm advertising on multiple sites, I can quickly determine which ones are paying for themselves and which ones need to be dumped.
 


DAMN! Your sig just was perfectly synchronous with the music I'm listening to.


Thanks for the script BTW
 
There is a catch, you can only have one postback URL per account. If you have multiple sites that use different databases on different sites / servers you'll have to set up multiple accounts with Copeac.

huh? there are so many different ways to accomplish what you are trying to do here...

So you're trying to track conversions? or what? Why don't you just use sessions or cookies?
 
huh? there are so many different ways to accomplish what you are trying to do here...

So you're trying to track conversions? or what? Why don't you just use sessions or cookies?

I actually need to see when it's credited to the account. Plus, I'm not a very good coder (wouldn't even qualify as a script kiddie) so I'm not familiar with how to do it with sessions or cookies.
 
Status
Not open for further replies.