0

Client has pdf's embedded in pages. They want to track pdf clicks. Statistics tracks nodes and there are add-on modules that track file field clicks, but I haven't seen anything within Drupal to track the embedded files. Any suggestions?

1 Answer 1

0

The gist of most Drupal performance-tuning essays is don't use the statistics module, because it causes a lot more Drupal DB traffic.

I can't help with configuring the statistics module itself and I suspect the reason the links aren't being monitored is that those files are being delivered from the sites/.../files folder by Apache|Nginx directly, and Drupal isn't seeing them. As such, you might be able to monitor the webserver logs to get the info you need.

Alternatively I would start off by looking at google analytics or some similar client-side tool for this. If that isn't suitable (and it's not guaranteed it is), then next step could be to create a handler for your files, e.g. a ctools module, which parses the path to get the file to deliver, logs whatever info is appropriate and then sends the file onward. There are some issues re: caching and headers, but not very hard.

If you could do that, but are stymied because the file links are entered by the user within nodes, perhaps you could add a text content filter (such as those that break paragraphs at newlines) that read in the original URL and converted those matching the right pattern to the monitored form. That isn't hard either.

1
  • You've got me on the right track. After posting I realized I didn't know how the client is placing files. They already have Google Analytics on the site, so I did have that in mind as a usable tool.
    – icicleking
    Commented Mar 20, 2015 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.