Join Free
+ Reply to Thread
Results 1 to 3 of 3
  1. #1

    Monetising outbound links without redirecting everyone through a prosperlink

    I run something of a search engine - I have no idea where the outbound links might go, but from stats I know that roughly 5.3% of them are monetisable through Prosperent.

    There are lots of reasons why I don't want to not send every user through an affiliated link, the main ones are:
    - It looks weird if I try to send people through an affiliate network to get to twitter (as I said, 95% of outbound links are not monetisable)
    - I want the ability to send users through other affiliate networks or my own monetising code if the website is not available through Prosperent
    - If prosperent goes down, I still want my users to reach their destination URL.

    In addition, I want to fire a hit to Google Analytics for every outbound click. This way, I can track how many outbound clicks there have been, which ones were monetised, which ones were not (so that I can investigate other ways to monetise clicks to non-merchants), etc.

    Maybe my script will help someone who is attempting to do something similar

    All outbound links are to /go.php?b=[BASE64 ENCODED URL]

    go.php:
    PHP Code:
    <?php
    if(isset($_GET["b"])){
        
    $url base64_decode(urldecode($_GET["b"]));
    }
    header("Location: ".getLink($url));   

    /// Functions ///
    function getLink($u){
        
    $networks = array("own","prosperent","other-network"); // First look for my own solution for this host, then prosperent, then other
        
    foreach($networks as $n){
            if(isset(
    $redirect) == FALSE){ 
                
    $dat getMonURL($u,$n);
                if(
    $dat["status"] == TRUE){
                    
    $redirect $dat["url"]; 
                }
                
            }
        }
        
    // Final checks
        
    if(isset($redirect) == FALSE OR strlen($redirect) == 0){ // No monetised version available
            
    $redirect $u
            
    gaFireHit($u,false);
        }else{ 
    // Tell GA we've got a monetised hit
            
    gaFireHit($u,true,$dat["source"]); 
        }
        
        return 
    $redirect;
    }

    function 
    getMonURL($u,$n){

        switch (
    $n) {
        case 
    "other-network":
            
    $req "http://other-network.com/whatever?out=!!URLENC!!&loc=!!LOCENC!!&format=txt";
            
    $pattern "other-network"// if returned link contains "other-network", this is a monetised link
            
    $ret callEnd($u,$req,$pattern); 
            break;
        case 
    "prosperent":
            
    $req "http://prosperent.com/api/linkaffiliator/url?apiKey=[API KEY]&url=!!URLENC!!&location=!!LOCENC!!";
            
    $pattern "prosperent.com"// if returned link contains "prosperent.com", this is a monetised link
            
    $ret callEnd($u,$req,$pattern);
            break;
        case 
    "own":
            
    $ret = array("status"=>false);
            break;
        }
        return 
    $ret;
    }

    function 
    callEnd($u,$req,$pattern){
        
    $req str_replace("!!URLENC!!",urlencode($u),$req); //set destination URL variable
        
    $req str_replace("!!LOCENC!!",urlencode("https://www.mydomain.com/search/"),$req); // Set "from" variable
        
    $ch curl_init($req);
        
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
    curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
    $t curl_exec($ch);
        
    curl_close($ch);
            
        if(
    stristr($t,$pattern)){
            return array(
    "status"=>true,"url"=>$t,"source"=>$pattern);
        }else{
            return array(
    "status"=>false);
        }
    }

    function 
    gaFireHit$u $m$n="none") {
        
    $ip $_SERVER['REMOTE_ADDR'];
        
    $udat parse_url($u);
        
    $data = array(
          
    'v' => 1,
          
    'tid' => "UA-XXXXXXXXX-X",
          
    'cid' => md5($ip),
          
    't' => 'pageview',
          
    'dt' => ($m==true)?("Monetised - $n"):("Normal - $n"),
          
    'dp' => "/".$udat["host"]."/".base64_decode($_GET["b"]),
          
    'uip' => $ip,
          
    'ua' => $_SERVER["HTTP_USER_AGENT"]
        );
      if ( 
    $data ) {
        
    $getString 'https://ssl.google-analytics.com/collect';
        
    $getString .= '?payload_data&';
        
    $getString .= http_build_query($data);
        
    $result file_get_contents$getString );
        return 
    $result;
      }
      return 
    false;
    }
    ?>

  2. #2
    Prosperent won't monetize Twitter, because there is nothing TO monetize. So they won't change that link to an affiliate link (If you're using ProsperLinks). They only monetize where they can, so if you link to http://6pm.com on your blog posts or search engine results, if you run ProsperLinks, it will automatically change 6pm.com to something that means you will make a bit of cash when the user hits the site.

    The redirect is usually so quick that the user won't notice it, so won't look weird (especially in your twitter example)

    Prosperent has a 99.994% uptime (if memory serves)

    That means, in a 365 day period, they're down 31 minutes 30 seconds in that year. Their uptime has improved in the last few months with several servers added on as well (they improved their architecture quite dramatically)

    As for tracking everything through GA, I'm not 100% sure about this, however with Prosperent you have an API you could check that you could correlate the data very easily to see how many outbound clicks went through their system vs your own

  3. #3
    We work with a large number of search engines actually. It's a great fit because we only monetize the links that we are able to monetize. This doesn't disrupt your other clicks in any way. For even more control, you can also use our links api. With the links api, you supply the url, and we give you back an affiliate link if it can be monetized, otherwise we give you back the same link you provided, and you can send the user along with no modification to the url they click. Let us know if you have any questions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
coupons | coupons and deals