Home > > Coreg

Update SilverPath Revenue on P202 Automagically (10)


08-06-2011 07:44 PM #1 bbrock32 (Administrator)
Update SilverPath Revenue on P202 Automagically

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.


08-06-2011 07:58 PM #2 hd2010 (Member)

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


08-07-2011 06:30 AM #3 tijn (Moderator)

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.


08-07-2011 11:53 AM #4 bbrock32 (Administrator)

Quote Originally Posted by hd2010 View Post
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
Won't a tracking pixel or postback url solve this ?


08-07-2011 03:01 PM #5 hd2010 (Member)

@bbrock32 : mine one looks screwed, might be mixed up


08-08-2011 08:22 PM #6 pbakos92 (Member)

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.


08-10-2011 12:31 AM #7 vidivo (Member)

whats a good cron job timeframe for this and anyone have an example of how it should look?


08-10-2011 10:38 AM #8 bbrock32 (Administrator)

I do it every 30 mins.

It would look like :

*/30 * * * * lynx -dump http://domain.com/tracking202/sp.php


08-11-2011 05:48 AM #9 Mr Payne (Member)

I just love this forum


08-17-2011 09:17 PM #10 sm1810 (Member)

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

Code:
<?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>";



?>


Home > > Coreg