Home > Vendors >

Tracking ShareaSale with Prosper202 (3)


06-17-2011 09:53 PM #1 convinceme (Member)
Tracking ShareaSale with Prosper202

Is there a way to track ShareaSale campaigns in 202?

I'm looking for a place to put a universal postback URL but can't find anything.


06-18-2011 03:54 PM #2 convinceme (Member)

I found a script by Eric Nagel but don't have the first idea about how to use it.

Could someone please take a look and poit me inthe right direction?

it's from this page.
http://www.ericnagel.com/2010/01/sha...rosper202.html

Code:
$dYesterday = date("m/d/Y", time()-86400);
 
$cURL = 'https://shareasale.com/x.cfm?action=activity&affiliateId=yourid&token=yourtoken&dateStart=' . $dYesterday . '&dateEnd=' . $dYesterday . '&XMLFormat=0';
// $cURL = 'sas.csv';
 
$fp = fopen($cURL, "r");
if ($fp) {
    $rsMap = array();
    while (empty($rsMap) && (($rsHeadings = fgetcsv($fp, 1000, "|")) !== FALSE)) {
        if (md5(serialize($rsHeadings)) != '5b448a7bdbeea0be7d7f758f5f8ee90b') {
            // echo(md5(serialize($rsHeadings)) . "\n");
            // print_r($rsHeadings);
 
            while (list($nIndex, $cColumn) = each($rsHeadings)) {
                // echo("$cColumn => $nIndex<br />\n");
 
                $cColumn = ereg_replace("\(.+\)", "", $cColumn);
 
                $rsMap[$cColumn] = $nIndex;
            } // ends while (list($nIndex, $cColumn) = each($rsHeadings))
            // print_r($rsMap);
        } // ends
    }
 
    /*
    Array
    (
        [Trans ID] => 0
        [User ID] => 1
        [Merchant ID] => 2
        [Trans Date] => 3
        [Trans Amount] => 4
        [Commission] => 5
        [Comment] => 6
        [Voided] => 7
        [Pending Date] => 8
        [Locked] => 9
        [Aff Comment] => 10
        [Banner Page] => 11
        [Reversal Date] => 12
        [Click Date] => 13
        [Click Time] => 14
        [Banner Id] => 15
    )
    */
    while (($rsStatData = fgetcsv($fp, 1000, "|")) !== FALSE) {
        // print_r($rsStatData);
        if (
            (md5(serialize($rsDeal)) != '5b448a7bdbeea0be7d7f758f5f8ee90b') &&
            ($rsStatData[$rsMap['Commission']] > 0) &&
            !empty($rsStatData[$rsMap['Aff Comment']]) &&
            ($rsStatData[$rsMap['Aff Comment']] != "none")
            ) {
 
            $cPostback = 'http://yourdomain.com/tracking202/static/gpb.php?amount=' . urlencode($rsStatData[$rsMap['Commission']]) . '&subid=' . urlencode($rsStatData[$rsMap['Aff Comment']]);
            // echo("$cPostback\n");
            $fpPostback = @fopen($cPostback, "r");
            if ($fpPostback !== false) {
                fclose($fpPostback);
            } // ends
 
        } // ends if (!empty($rsDeal))
 
    } // ends while (($data = fgetcsv($fp, 1000, "|")) !== FALSE)
    fclose($fp);
} // ends if ($fp)


06-19-2011 05:16 AM #3 3223 (Member)

I was going to post that but wasn't sure if it was what you were looking for. It just grabs a report from shareasale using their API and imports it into prosper 202. Just put this in a php file on your server and run it manually or setup a cron to run it everyday or whenever. You just have to sign up for a Token Key to use the API.

It looks like all you have to change is:
affiliateId=yourid
token=yourtoken
yourdomain.com


Home > Vendors >