propellerads adcombo
Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

C.J.com Conversions With Prosper202

Discussion in 'Guides, Case Studies and Tutorials' started by jims45, Sep 15, 2014.

  1. jims45

    jims45 Affiliate affiliate

    69
    23
    8
    trackingcj.png
    Tracking C.J.com Conversions With Prosper202


    For a long time
    I struggled with Prosper202 and it took time to understand the set up procedure. Thanks to the excellent guide on this Forum and the many videos available online I can now set up campaigns easily.

    Tracking CJ with Prosper202

    For those of you that run Commission Junction campaigns here is a handy script I discovered online that enables you to track conversions on auto, you can find it here:

    Tracking CJ Commissions with Prosper202 - Eric Nagel

    Code

    PHP:
    <?php
        $cDevKey 
    'your-developer-key';
        
    $cURL 'https://commission-detail.api.cj.com/v3/commissions?';
        
    $cURL .= 'date-type=event&';
        
    $ch curl_init();
        
    curl_setopt($chCURLOPT_URL$cURL);
        
    curl_setopt($chCURLOPT_HTTPHEADER, array(
                      
    'Authorization: ' $cDevKey,
                      
    'User-Agent: "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3.0.15 GTB6 (.NET CLR 3.5.30729)"'
                    
    ));
        
    curl_setopt($chCURLOPT_HEADERfalse);
        
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
    curl_setopt($chCURLOPT_CONNECTTIMEOUT10);
        
    curl_setopt($chCURLOPT_TIMEOUT10);
        
    $cHTML curl_exec($ch);
        if (
    curl_error($ch)) {
            echo 
    "Curl error: " curl_error($ch);
        } 
    // ends if (curl_error($ch))
        
    else {
            
    $cXML simplexml_load_string($cHTML);
            for (
    $i 0$i count($cXML->commissions->commission); $i++) {
                
    $oCJCommission $cXML->commissions->commission[$i];
                
    $cPostback 'http://yourdomain.com/tracking202/static/gpb.php?amount=' urlencode($oCJCommission->{'commission-amount'}) . '&subid=' urlencode($oCJCommission->sid);
                
    $fpPostback = @fopen($cPostback"r");
                if (
    $fpPostback !== false) {
                    
    fclose($fpPostback);
                } 
    // ends if ($fpPostback !== false)
            
    // ends for ($i = 0; $i < count($cXML->commissions->commission); $i++)
        
    // ends else from if (curl_error($ch))
    ?>
    You will also need to know how to add the Prosper [[subid]] token to your CJ link, take a look at the screenshot and you will see it is really quite simple to do.
    I use the script with an unmanaged VPS and set up a cronjob to run it at 4am daily, this sounds complicated but the excellent support community at Digital Ocean soon helped me set that up with simple commands.
    If you don't feel comfortable with syntax, here is a site that will create the cronjob syntax for you:

    Crontab Generator - Generate crontab syntax

    Problem solved...happy tracking! Prosper CJ.png
     
    Last edited: Sep 15, 2014

Featured Resources (View All)

adsxposed