Solved

RSS tracking?

Posted on 2007-03-20
3
317 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Learn about the eCommerce marketing trends for the year ahead.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now