1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Postback Script for ULOCK.IT (works for any network, but need modification)

Discussion in 'CPA' started by SEOBeginner, Sep 29, 2013.

  1. SEOBeginner

    SEOBeginner Registered Member

    Joined:
    Aug 19, 2012
    Messages:
    62
    Likes Received:
    26
    Okay, I see that many people are trying to have a great content locker but not wanting to pay. So they use Ulock.it (a content locker service of AdGate Media).

    For some reasons, I can not find the postback script that works for this (because they configured differently). So after struggling some hours, I've come up with this postback script for Adwork Media.

    There are 3 things you need to do in order for the postback to work:

    1. Set up your Tracking URL (when adding offers) in your Ulock.it account like this:
    http://www.adworkmedia.com/go.php?camp=412&pub=1234&id=4213&sid={clickid}
    This only applies to AdworkMedia.

    The "sid" stands for SubID which might change for any other networks. These variations might apply:
    • subid
    • sid
    • s1
    and many others. So you need to look at your network's campaign's URL and decide which will store the SubID to the report of your network.


    2. Create a postback.php file and modify something in it:

    PHP:
    <?php

    if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {    // Get Real IP                
        
    $IP $_SERVER['HTTP_X_FORWARDED_FOR']; 
    } else { 
        
    $IP $_SERVER['REMOTE_ADDR'];
    }    
    //You might need to change the IPs, or just remove the "if" function completely, because this is to check the IP of Adwork Media Server :)
    if ($IP=="67.227.230.75" || $IP=="67.227.230.76") {      // Prevent against fraudulent postback attempts and verify that the postback IP is from an official AdWork Media Server

            // get variables and prevent against SQL injections
            
    $campaign_id mysql_real_escape_string($_GET['campaign_id']);            // Campaign ID
            
    $campaign_name mysql_real_escape_string($_GET['campaign_name']);        // Campaign Name        
            
    $subid mysql_real_escape_string($_GET['sid']);                         // Primary SubID

    //You need to change the "sid" to any other variations of SubID that your network might use.

            
    $subid2 mysql_real_escape_string($_GET['sid2']);                      // Secondary SubID2
            
    $subid3 mysql_real_escape_string($_GET['sid3']);                      // Secondary SubID3
            
    $commission mysql_real_escape_string($_GET['commission']);            // Commission        
            
    $status mysql_real_escape_string($_GET['status']);                      // Status: 1 (Credited) or 2 (Reversed)
            
    $ip mysql_real_escape_string($_GET['ip']);                              // User IP Address
            
    $reversal_reason mysql_real_escape_string($_GET['reversal_reason']);  // Reversal Reason (usually not sent)
            
    $vc_value mysql_real_escape_string($_GET['vc_value']);                  // Virtual Currency Only - VC Ratio * Commission    
        
    }
        if (
    $status==1) {    
            echo 
    '<script>window.location.href = "http://ulock.it/postback/YourUniqueCodeHere/'.$subid.'";</script>'//Resend the SubID to ulock.it
            
        
    } elseif($status==2) { // Status 2 is a Reversal/Chargeback Notification usually due to a fraudulent lead
            // Place Revoke Code Here
            // Subtract a Credit or Points from a user so that you don't lose money for revoked leads    
        
    }
     
    // End IP Validation

    ?>
    Change the "sid" in

    $sid = mysql_real_escape_string($_GET['sid']);

    to anything that your network will send to your postback script as SubID. Like this:
    4qsf8i.jpg


    Then change the YourUniqueCodeHere to your own.

    echo '<script>window.location.href = "http://ulock.it/postback/YourUniqueCodeHere/'.$subid.'";</script>';

    You can get yours in:
    2hn72gh.jpg

    3. Upload postback.php to your host (any host that supports PHP) and give the URL http://yourwebsite.com/postback.php to your network.

    Example:

    2iqhlde.jpg

    There might be something that I've missed. I'll add it later if there is something that I need to add :)

    Now, enjoy your Ulock.it's Content Locker :)

    P/S: This is the first time I post a thread which explains these kinds of things. So I'll edit the post if I see something goes wrong. :p
     
    • Thanks Thanks x 7
    Last edited: Sep 30, 2013
  2. jameshacker

    jameshacker Newbie

    Joined:
    Sep 1, 2013
    Messages:
    49
    Likes Received:
    16
    This looks very nice. Thank you very much for this. ;)
     
    • Thanks Thanks x 1
  3. SEOBeginner

    SEOBeginner Registered Member

    Joined:
    Aug 19, 2012
    Messages:
    62
    Likes Received:
    26
    You're welcome. Just wanna share the script that many people might be looking for, and Ulock.it does not create a sample script for users :p

    P/S: I forgot to say thank you to Adgate who had brought us an amazing Content locker service for free.

    So, thank you, Adgate :)
     
  4. Weblycos

    Weblycos Senior Member Premium Member

    Joined:
    Feb 12, 2013
    Messages:
    931
    Likes Received:
    183
    Occupation:
    full time IM
    This is outstanding stuff. Thank you for this man.
     
    • Thanks Thanks x 1
  5. royserpa

    royserpa Jr. VIP Jr. VIP Premium Member

    Joined:
    Sep 28, 2011
    Messages:
    4,649
    Likes Received:
    3,494
    Gender:
    Male
    Occupation:
    Negative Options aka Rebills!
    Location:
    Royserpa
    Home Page:
    For the people that dont understand what a postback script is, it is basically a script that creates, modifies or submit content to databases or w/e after someone completes an offer ;)
     
    • Thanks Thanks x 1
  6. innosoft

    innosoft Jr. VIP Jr. VIP Premium Member

    Joined:
    Nov 25, 2008
    Messages:
    1,633
    Likes Received:
    639
    Occupation:
    Software Developer, SEO
    Location:
    Office
    Home Page:
    looks very nice..
     
    • Thanks Thanks x 1
  7. dbdnvikas

    dbdnvikas Junior Member

    Joined:
    Feb 18, 2011
    Messages:
    188
    Likes Received:
    65
    Location:
    BHW
    Hey, Just wanted to know what is the use of this PostBack Script?
    I'm new on AdworkMedia, and don't how any clue about this :confused:..
     
  8. SEOBeginner

    SEOBeginner Registered Member

    Joined:
    Aug 19, 2012
    Messages:
    62
    Likes Received:
    26
    This postback script is used for Ulock.it content locker service. If you do not want to use Ulock.it, then you don't need this postback script. You can just use AdworkMedia's content locker.

    In case you want to use Ulock.it in the future, you might need this postback script to "receive" the information that AdworkMedia will send to you when a user completes an offer, so Ulock.it knows when/who to "unlock" their locker :)

    It's basically just an information receiver for Ulockit, nothing more :)
     
    • Thanks Thanks x 1
  9. dbdnvikas

    dbdnvikas Junior Member

    Joined:
    Feb 18, 2011
    Messages:
    188
    Likes Received:
    65
    Location:
    BHW
    This will also work with CPAL*EA*?
    They also use subid but instead of sid they use complete "subid". I just have to replace the thing that you have mentioned, right?
     
  10. YourC0der

    YourC0der BANNED BANNED

    Joined:
    Nov 24, 2013
    Messages:
    22
    Likes Received:
    0
    you should try another cpa network, go with the offers that convert and promote them.
     
  11. allemu

    allemu Regular Member

    Joined:
    Feb 19, 2011
    Messages:
    246
    Likes Received:
    268
    thx, i will try it very soon...
     
  12. umerjutt00

    umerjutt00 Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 28, 2011
    Messages:
    3,649
    Likes Received:
    1,908
    Occupation:
    Ninja