Miscellaneous ⇒ Chit-Chat :: Archives ⇒ Tracking clicks on Rss Feeds, need help with code :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexChit-Chat

Archived ⇒ Tracking clicks on Rss Feeds, need help with code


thanks, basically what I am trying to do is use google analytics to track clicks on rss feeds in my site. My problem is getting the php variable $title2 to show up in the javascript code. I am working with line 80 in the rss.php file. Below is the code I have put into place thus far, just need to get the $title2 variable to show up in the path so I can track individual headlines.

Default code is:

//$data .= '<strong><big>·</big></strong> <a href="'.$link.'" target="new">'.$title2.'</a><br/>'."\n";

My new code:
//$data .= '<strong><big>·</big></strong> <a href="'.$link.'" target="new" rel="nofollow" onClick="javascript: pageTracker._trackPageview("/rssclicks/"$title2"");">'.$title2.'</a><br/>'."\n";

I am guessing it is an isse passing a php varialbe to javascript, but there must be some way around this, and I am also not sure how to quote out the varialbe single quote, double quote, () [] or what.

thanks for your help

-Dustin

Celebrity Babes | Celebrity Videos | Funny Videos | Information for Men

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1


$data .= '<strong><big>·</big></strong> <a href="'.$link.'" target="new" rel="nofollow" onClick="javascript: pageTracker._trackPageview("/rssclicks/'.$title2.'");">'.$title2.'</a><br/>'."\n";

or

$data .= '<strong><big>·</big></strong> <a href="'.$link.'" target="new" rel="nofollow" onClick="javascript: pageTracker._trackPageview(\'/rssclicks/'.$title2.'\');">'.$title2.'</a><br/>'."\n";

Gaming League / Cup - www.leaguecms.co.uk :: Other DragonFly modules - www.cmsdreams.co.uk

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


thanks, I'll give it a shot and let reply with results

-Dustin

Celebrity Babes | Celebrity Videos | Funny Videos | Information for Men

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1


Looks like the first one worked, although I thought I tried that before and got an error. I didn't try the second although seems like that would work as well. Thanks for the help!

-Dustin

Celebrity Babes | Celebrity Videos | Funny Videos | Information for Men

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1


correction, I had to use the second option to escape the quotes, all is working great now. I can now track clicks on my RSS feeds just as I can with normal links. Thanks again

-Dustin

Celebrity Babes | Celebrity Videos | Funny Videos | Information for Men

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1

All times are UTC