Hi all...
Looking for a little help. I'm using views_pdf to generate a downloadable PDF for my users. A call to the PDF view does not generate any rows in the accesslog table. Is there a Drupal function I can use to write to the accesslog? Or do I need to build an INSERT SQL statement manually in a hook?
Basically, the PDF download is our conversion goal. Business users (given access to the admin reports) want a quick view of how many hits to the PDF there have been over a specific time period. We also want to eventually export these hits (and their associated users) to develop leads, so it is important to capture these in the database.
Any help is appreciated. Is this something I should create an issue for? Is a module responsible for writing to the accesslog? What triggers a write to accesslog? An HTML page being generated?
Thanks,
Dave
Comments
_
If you want to track hits to the node that contains the pdf, you can use the core statistics module. If you want to count actual downloads, you can use the download_count module.
And if you really do want to write code, see what functions the core statistics module uses.
_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.
I'm OK with writing some code
I'm OK with writing some code in a module, I just wasn't sure if there was some type of Drupal functions to accomplish this. I believe I found the place where hits are being recorded...
modules/statistics/statistics.module - statistics_exit()
There is a simple db_query() call to INSERT the data to the accesslog table. I think I'll just have to figure out the appropriate place to put this for my need. The PDF is not an actual NODE... it is being generated based on several flagged nodes. So, for example, each page is a node... and a user selects 6 pages, the "download link" will use a view to bring back those 6 selected pages, and compile them into a PDF for download. This is how I'm using views_pdf. However, calls to the PDF display of the view do not get stored in the accesslog.