Tracking clicks on Rss Feeds, need help with code
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexChit-Chat
Author Message
dusman
Dragonfly addicted


Joined: Mar 17, 2006
Posts: 303
Location: Maryland

PostPost subject: Tracking clicks on Rss Feeds, need help with code
Posted: Tue Jan 08, 2008 5:03 pm
Reply with quote

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>&middot;</big></strong> <a href="'.$link.'" target="new">'.$title2.'</a><br/>'."\n";

My new code:
//$data .= '<strong><big>&middot;</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

dusman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1
Back to top
View user's profile Visit poster's website
Kendle
500+ Posts Club


Joined: Dec 16, 2004
Posts: 529

PostPost subject: Re: Tracking clicks on Rss Feeds, need help with code
Posted: Tue Jan 08, 2008 8:27 pm
Reply with quote

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

or

Code:
$data .= '<strong><big>&middot;</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

Kendle's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website
dusman
Dragonfly addicted


Joined: Mar 17, 2006
Posts: 303
Location: Maryland

PostPost subject: Re: Tracking clicks on Rss Feeds, need help with code
Posted: Tue Jan 08, 2008 8:57 pm
Reply with quote

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

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

dusman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1
Back to top
View user's profile Visit poster's website
dusman
Dragonfly addicted


Joined: Mar 17, 2006
Posts: 303
Location: Maryland

PostPost subject: Re: Tracking clicks on Rss Feeds, need help with code
Posted: Tue Jan 08, 2008 9:17 pm
Reply with quote

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

dusman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1
Back to top
View user's profile Visit poster's website
dusman
Dragonfly addicted


Joined: Mar 17, 2006
Posts: 303
Location: Maryland

PostPost subject: Re: Tracking clicks on Rss Feeds, need help with code
Posted: Wed Jan 09, 2008 2:51 pm
Reply with quote

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

dusman's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/Apache 1.3/4.1.21/5.2.1/9.2.0.RC1
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   Printer Friendly Page     Forum IndexChit-Chat All times are GMT
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Dedicated Server & Bandwidth Sponsored by DedicatedNOW
User Info [x]

Welcome Anonymous

Nickname
Password
(Register)

Last CVS commits [x]

Languages [x]

Community [x]

Support for DragonflyCMS in a other languages:

Deutsch
Español

X-links [x]
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

Preview theme [x]
Each user can view the site with a different theme.
Themes marked with a * also change the forum look.


You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
This page generated in 0.6855 seconds with 16 DB Queries in 0.0793 seconds
Memory Usage: 2.9 MB
Interactive software released under GNU GPL, Code Credits, Privacy Policy