Solved

RSS tracking?

Posted on 2007-03-20
3
320 Views
Last Modified: 2013-11-18
How to track views and clicks on a RSS feed? Our feed is created using PHP and is running on our own server, but we are looking for a way to get some analytics on it. It's no option to use a solution like feedburner... We want to build something of our own or use a 3th party tool that we can plug in on the existing feed.
0
Comment
Question by:topevents
3 Comments
 
LVL 11

Expert Comment

by:JamesCssl
ID: 18757081
0
 

Author Comment

by:topevents
ID: 18757150
Javascript is no solution for RSS feeds... We don't want to track the actual subscription process, but the active users, clicks on items in RSS,...
0
 
LVL 8

Accepted Solution

by:
jawahar_prasad earned 500 total points
ID: 18757616
Its simple:

TRACKING IMPRESSIONS:

You can track which webpage is requesting your feed or you can track the number of Impressions your feed is receiving like this:

1. Assuming that your .php page generates the .XML feed.
2. In the PHP page that generates the XML feed example, generatefeed.php add the following code,

if INSTR(trim(Request.ServerVariables("HTTP_REFERER")),"")=false then
 set fs=Server.CreateObject("Scripting.FileSystemObject")
 set f=fs.OpenTextFile(Server.MapPath("RSSREFERER.txt"),8,true)
 f.WriteLine "Requested Page: " & Request.ServerVariables("HTTP_REFERER") & "Time: " & now()
 f.Close
 set f=Nothing
 set fs=Nothing
end if

With the above code you can track which page is requesting your feed and the time. The above code uses txt file, you can use database if you want.

TRACKING CLICKS:

Similarly to track clicks in the URL displayed in the feed, you should update the database count whenever the user visits that page through the feed by passing the tracking id in the URL querystring.

Example:

<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
 <channel>  <title>Ajax Tutorials</title>
  <link>http://www.expertsforge.com/rss-feeds/rss-feeds.asp</link>
  <description>This Feed brings you the Tutorials and Solutions found at Expertsforge.com for the category : Ajax</description>
  <pubDate>Tue, 20 Mar 2007 21:45:57 GMT</pubDate>
  <generator>Expertsforge.com XML Generator</generator>
  <copyright>Expertsforge.com</copyright>
  <managingEditor>contact@expertsforge.com</managingEditor>
  <webMaster>contact@expertsforge.com</webMaster>
 <item>
 <item>
  <title>Creating RSS Reader using AJAX with Code</title>
  <link>http://www.expertsforge.com/Web-Development/Tutorial-140.asp</link>
  <description>Ajax</description>
  <pubDate>Mon, 29 Jan 2007 14:06:43 GMT</pubDate>
  </item>
  </channel>
  </rss>

In the above feed, you can find the <link> item.... In that you must pass the tracking id which can be

<link>http://www.expertsforge.com/Web-Development/Tutorial-140.asp?from=feed</link>

In the above code a new tracking id(from=feed) is added,
so, in the Tutorial-140.asp page you can find if it is "from=feed" then update the database count corresponding to that feed.


THATS IT!!!!!!!!!!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
A great marketing strategy is diverse.  Read about the not so popular, yet effective, marketing tactics you can start using today!
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question