Hey everyone ,
this is going to be a quick post showing you how to update revenue from Silverpath automatically in P202.
It's a pretty simple script that uses Silverpath's API and in the next days I'll post a solution for CPVLab too.
**IMPORTANT**
For this script to work you must be sure you are passing the P202's subid as the subid in silverpath.
I have explained this in the Basic Coreg Guide I have posted.
Just to remind you , the subid you should pass to SilverPath is the $t202subid variable as below :
[PHP]
session_start();
$t202subid=$_COOKIE['tracking202subid'];
[/PHP]
Now , to get this working you need to :
1 - Download the script from here :
stmforum.com/forum/files/sp.rar
2 - Extract it in inside the tracking202 folder ( part of your P202 install )
3 - Edit the file params.php and enter your silverpath id (not the email you use to login!! ) and password.
To get your id go to to this urls after you have logged in to Silverpath.
http://www.silver-path.com/app/affiliate_referral.php
It's a number and should look like in the screenshot below ( I have replaced mine with xxx in the pic below for privacy issues )
![]()
4 - Run it from your browser or better , set a cron job to get revenue automatically.
If your P202 is installed on http://domain.com you can run the script by browsing http://domain.com/tracking202/sp.php.
This will get revenue for yesterday and today only.
If you wish to get update the revenue for other dates you would have to browse this url :
domain.com/tracking202/sp.php?sd=2011-08-01&ed=2011-08-06
Change the value of sd with the start date and ed with the end date you want.
5 - Give me some thanks 
Let me know if you have any questions.
Updating revenue issue also come across my mind today, is just repetitive task. not sure do you have any solution for LinkTrust platform (EWA) and also Cake platform (C2M, Motive, WSM), accurate revenue is a must
cpvlab has the option to update the revenue per subid by pasting subid,revenue in the update subid form. as far as i know you dont have this option with the conversion pixel or postback url yet.
@bbrock32 : mine one looks screwed, might be mixed up
If you run a coreg-powered offer using an affiliate platform, a tracking pixel won't do anything. Most coreg paths don't let you place pixels, and even if you did the pixel would do nothing since everything is based off a rev share instead of CPA basis.
whats a good cron job timeframe for this and anyone have an example of how it should look?
I do it every 30 mins.
It would look like :
*/30 * * * * lynx -dump http://domain.com/tracking202/sp.php
I just love this forum 
Warning: Invalid argument supplied for foreach() in /nfs/c09/h03/mnt/132863/domains/MYDOMAIN/html/tracking202/sp.php on line 25
hmm... i get this error, any idea? blanked out the domain
<?php
include_once("func.php");
include_once ("params.php");
//Dates
$today = date("Y-m-d");
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));
$tomorrow=date("Y-m-d",$tomorrow);
$yesterday = mktime(0, 0, 0, date("m") , date("d")-1, date("Y"));
$yesterday=date("Y-m-d",$yesterday);
$sd=@$_GET['sd'];
$ed=@$_GET['ed'];
if(!isset($sd))
$sd=$yesterday;
if(!isset($ed))
$ed=$tomorrow;
$spurl="http://www.silver-path.com/API/api.php?u=$id&p=$pass&rid=$rid&sd=$sd&ed=$ed&isCSV=$csv";
$data=file_get_contents($spurl);
$dec=json_decode($data,TRUE);
$data=$dec['data'];
foreach($data as $el){
$subid=$el['SUBID1'];
$rev=$el['Affiliate Revenue'];
if($rev!="0.00" && is_numeric($subid)===TRUE){
echo "$subid-$rev<br>";
UpadateSPRev($subid,$rev);
}
}
echo "Finished, you can close this window!<br>";
?>