Created
December 27, 2013 21:50
-
-
Save NathanQ/8153140 to your computer and use it in GitHub Desktop.
just a django template. If you use django filer / github.com/stefanfoulis/django-filer and google analytics on your web site and want to see those file clicks on the analytics reports, use this trackable link template. (formatting for legibility)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if object.file.url %} | |
<a href="{{ object.file.url }}" onclick="_gaq.push(['_trackEvent', 'File Downloads', 'Downloaded', '{{ object.file }}']);"> | |
{% if object.title %} | |
{{ object.title|safe }} | |
{% else %} | |
<img src="{% file_icon object %}" alt="Download File" /> | |
{% endif %} | |
</a> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment