XF 2.1 How to count the number of times a PDF in a widget is opened?

tomwood

Member
I offer a free sample of one of my books via a PDF. The PDF is offered in both a regular forum thread and also in a widget - public sidebar. The forum thread doesn't open the PDF in a PDF reader, but does keep count of the number of downloads. The advantage of using a widget to offer a free sample is that it automatically opens in a PDF reader so a visitor can check it out right away. However, the widget doesn't seem to be able to count the number of times the PDF is opened/downloaded. Is there a way to configure a widget so it will keep count?

Widget definition
HTML
Widget that lets you add custom HTML. This widget supports XenForo template syntax.

Perhaps some of the template syntax would work?
 
Top Bottom