locked
basic module question RRS feed

  • Question

  • User-1242214802 posted

    Hi All: I have an ASP website written primarily in VBScript, that logs all incoming traffic (requested page, referrer, source-code, etc) to a table in SQL2005. The website runs on server2003/IIS6. The tracking code runs as an include file on all the ASP pages.

    A blog was recently added using Wordpress, PHP and mySQL, and incoming traffic to the blog needs to be captured along with the rest of the website.

    Given that the site architecture will likely eventually migrate to .NET and IIS7, would it make sense to consolidate the tracking functionality to an HTTP module now? Would an HTTP module be able to intercept the PHP page requests so that the tracking could occur?

    Tuesday, May 5, 2009 6:08 PM

Answers

  • User-318989783 posted

     Yes you could use a httphandler to track stuff when you eventually move to the .Net platform. Except it will not intercept the php page, but I would go with a client side tracking implimentation, that is use a pixcel image to make a call to the http handler from within your PHP page or ASPX page. This gives you the flexibility of using the tracking tool to work with any web technology for now or in future.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 6, 2009 11:03 PM
  • User-318989783 posted

     Yes you understood me correctly, Im assuming it should only be one line of script in php that you would include in the root of the php application that will insert the refferer as a parameter in the image url. But again I am not sure of what your requirements are and if you did write something like that in PHP that would mean writing the whole filter and dataaccess again in php, Im not entierly  sure if this was only required by your php or aspx pages as well. Ill let you be the judge of what suites your  application best :) 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 8, 2009 8:12 AM

All replies

  • User-318989783 posted

     Yes you could use a httphandler to track stuff when you eventually move to the .Net platform. Except it will not intercept the php page, but I would go with a client side tracking implimentation, that is use a pixcel image to make a call to the http handler from within your PHP page or ASPX page. This gives you the flexibility of using the tracking tool to work with any web technology for now or in future.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 6, 2009 11:03 PM
  • User-1242214802 posted

    Thanks, I understand what you're saying, and I've implemented that handler for tracking email opens...but in this particular instance I need to capture more information, like the referrer and any QS variables that might have been passed in the original request. If I understand what you're suggesting, then I would only be able to track the fact that the page was viewed?

    If I was running server2008/IIS7, would there be any way to intercept the page request, even if it was for a PHP page? Or would I still have to look at some sort of ISAPI extension?

    Or is the only thing I can do is rewrite my tracking script in PHP for the PHP pages?

    Thursday, May 7, 2009 6:58 AM
  • User-318989783 posted

     Not really you can track more than just the page view. You can pass any additional information as parameters in the image url used for tracking and extract them form the query string. It's possible to write an isapi extension but wouldn't advise it for the effort involved when you can achieve the same thing withthe client side implimentation.

    Thursday, May 7, 2009 7:47 AM
  • User-1242214802 posted

    Thank you again for trying to help...the problem is I need to track activity when the page is first loaded...for example if someone clicks a link on a different website that points to this page, or if someone clicks on a link to this page from a search engine, I need to be able to capture the referrer. The only way I think I could do that is to write a PHP script that would then generate an image request in the page with the parameters you describe...but if I do that, I may as well just do everything in PHP? Or am I not understanding you correctly?

    Friday, May 8, 2009 8:00 AM
  • User-318989783 posted

     Yes you understood me correctly, Im assuming it should only be one line of script in php that you would include in the root of the php application that will insert the refferer as a parameter in the image url. But again I am not sure of what your requirements are and if you did write something like that in PHP that would mean writing the whole filter and dataaccess again in php, Im not entierly  sure if this was only required by your php or aspx pages as well. Ill let you be the judge of what suites your  application best :) 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 8, 2009 8:12 AM
  • User-1242214802 posted
    Thanks Ritesh: Currently the tracking is all done through VBScript on ASP pages. The website hasn't migrated to .NET (yet), so it seems like we'd need to just port the entire functionality to PHP for now (there is more than just logging to the dB, we also need to write cookies, pass other QS vals from PHP to ASP and back, etc.). If/when we migrate to IIS7 and .NET, then I think everything could be handled with a single module.
    Friday, May 8, 2009 2:10 PM