Created
February 7, 2014 19:26
-
-
Save crstn/8869961 to your computer and use it in GitHub Desktop.
Piwik RSS feed tracking via blind pixels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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