Home > Uncategorized > Google analytics plugin, modified

Google analytics plugin, modified

Ⅰ am using the $dt‑>blog(); » Google analytics plugin here on this site, but for tracking outgoing link clicks Ⅰ have had to modify the plugin like this:


add_filter('the_content', 'ga_addonclick', 10);

function ga_addonclick($value){

if(get_option('ga_onclick')){

    $value = preg_replace("/<a href=\"([^\"]+)\"/e",
    "'<a href=\'$1\' rel=\'nofollow\' onclick=\''.ga_parseurl('$1').'\''"   ,$value);
    }
    return $value;

}

function ga_parseurl($href){ $onclickcode = stripslashes(get_option(‘ga_onclick_code‘));

$href = str_replace('http://', '', $href); 

return str_replace('$site',$href,$onclickcode);

}


Related posts:

  1. Request: WordPress Plugin for Flickr and Ⅰ am looking for a way to integrate flickr and...
  2. Click Counter Plugin For WordPress Over at planetOzh there is a cool click counter for...
  3. In need of an automatic wordpress post scheduler plugin You know those moments where you have many ideas for...
  4. Getting Google\’s Firefox Bookmark Sync to Work This article sounds helpful. But now that Ⅰ have looked...
  5. Playing with the Google API — part 2 A short status update: Ⅰ have been playing quite a...

Ähnliche Artikel bereitgestellt von Yet Another Related Posts Plugin.

KategorienUncategorized Tags: , , ,
  1. Bisher keine Kommentare
  1. Bisher keine Trackbacks