Hi Allen, I am starting to think that is not possible to add a GA EventTracking through a wordpress function. ?? It did not work.
The link keeps messy:
<a "contenblog"]);"="" "clickout",="" _trackevent",="" onclick="_gaq.push([" rel="nofollow" target="_blank" href="https://feedproxy.google.com/.../">Link Title</a>
So I am gonna change my question, I changed my code to add a nofollow rel Attribute to the link, now it′s like this:
function ta_modified_post_title ($title) {
$post_options = get_option('rss_post_options');
$targetWindow=$post_options['targetWindow'];
if($targetWindow==0){
$openWindow='class="colorbox"';
}elseif ($targetWindow==1){
$openWindow='target=_self';
}else{
$openWindow='target=_blank';
$relNofollow='rel="nofollow"';
}
if ( in_the_loop() && !is_page() ) {
global $wp_query;
$postID=$wp_query->post->ID;
$myLink = get_post_meta($postID, 'rssmi_source_link' , true);
if (!empty($myLink)){
$myTitle=$wp_query->post->post_title;
$myLinkTitle='<a href='.$myLink.' '.$openWindow.' '.$relNofollow.'>'.$myTitle.'</a>'; // change how the link opens here
return $myLinkTitle;
}
}
return $title;
}
As you can see I added a $relNofollow=’rel=”nofollow”‘; and then added ‘.$relNofollow.’ to the link format. Working perfect! Is this code ok?
I also tried to add the EventTracking this way but no success.
Sry to disturb man, keep the good work!