Skip to content

Instantly share code, notes, and snippets.

@crstn
Created February 7, 2014 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crstn/8869961 to your computer and use it in GitHub Desktop.
Save crstn/8869961 to your computer and use it in GitHub Desktop.
Piwik RSS feed tracking via blind pixels
// Add this to the functions.php of your wordpress Theme. Get the URL for the tracking pixel from your Piwik instance.
function feedFilter($query) {
if ($query->is_feed) {
add_filter('the_content','feedContentFilter');
}
return $query;
}
add_filter('pre_get_posts','feedFilter');
function feedContentFilter($content) {
return $content.'<img src="http://xxx.org/piwik.php?idsite=x&rec=1&action_name='.get_the_title().'" style="border:0" alt="" />';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment