Where to best place tracking code for the rss feed?

Hi,
besides the podlove analytics i need piwik tracking for the rss feed. I placed the tracking code in the “feed-rss2.php” template, which works fine, but is not update save. Any idea where I can place the tracking code without loosing it with the next update?

Best,
Marc

Can you describe what exactly you mean by “tracking code”, give an example and describe how you want this to work?

Well, that’s the code:

<?php require_once "../piwik/PiwikTracker.php"; PiwikTracker::$URL = 'http://myurl.com/piwik'; $t = new PiwikTracker( $idSite = 4 ); $t->setTokenAuth('xxx'); $t->doTrackPageView('xxx'); $t->setIp($_SERVER['REMOTE_ADDR']); if(isset($_SERVER['HTTP_REFERER'])) $t->setUrl($_SERVER['HTTP_REFERER']); I placed it in the feed-rss2.php template. Works fine. But will be overridden with the next update. Any idea how to place it without loosing the changes?

If you want to survive updates you should implement this as a WordPress plugin.

But this is all about WordPress and has nothing to do with Podlove.