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

SEOBeginner

Regular Member
Joined
Aug 19, 2012
Messages
216
Reaction score
74
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
 
Last edited:
This looks very nice. Thank you very much for this. ;)

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 :)
 
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 ;)
 
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:..
 
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:..

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 :)
 
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?
 
you should try another cpa network, go with the offers that convert and promote them.
 
Back
Top