In this example I append an extra argument to the Mailpoet tracker url called uidhash. This happens to be the confirmation hash used by Mailpoet. The hook should be added to functions.php
.
function my_tracker_replaceusertags($email,$user){
$urls = array();
$results = array();// collect all links in email
if(!preg_match_all('#href[ ]*=[ ]*"(?!mailto:|\#|ymsgr:|callto:|file:|ftp:|webcal:|skype:)([^"]+)"#Ui',$email->body,$results)) return;
foreach($results[1] as $i => $url){
if(isset($urls[$results[0][$i]])|| strpos($url, 'wysija-key')) continue;