Переглянути джерело

Serve tracker pixel from Tangent's infrastructure

This is to enable some coarse metrics of who is using Oscar.  We just
look at the referer header to get a rough idea of which sites are using
Oscar.

This is an important measure for Tangent, Oscar's sponsor.  It's
documented in the release notes and we'll make sure everyone knows when
Oscar is released.  It's easy to opt out of.

Fixes #656
master
David Winterbottom 12 роки тому
джерело
коміт
3184e855ee

+ 19
- 2
docs/source/releases/v0.6.rst Переглянути файл

@@ -52,12 +52,16 @@ Other notable new features include:
52 52
 
53 53
 * `New helper methods`_ in the ``EventHandler`` class for order processing.
54 54
 
55
-* `Reworked seach app`_ with support for easy faceting.
55
+* `Reworked search app`_ with support for easy faceting.
56 56
 
57
-.. _`Oscar now supports Django 1.5`: `Django 1.5 and custom user model support`_
57
+Also, to help justify Tangent's sponsorship of Oscar, 
58
+a simple `tracking mechanism`_ has been introduced.
59
+
60
+.. _`Oscar now supports Django 1.5`: `django_support`_
58 61
 .. _`Partners can now have addresses`: `Partner addresses`_
59 62
 .. _`Customer wishlists`: `Wishlists`_
60 63
 .. _`New helper methods`: `Order processing changes`_
64
+.. _`tracking mechanism`: `Tracking Oscar sites`_
61 65
 
62 66
 What's new in Oscar 0.6?
63 67
 ========================
@@ -183,6 +187,8 @@ Further reading:
183 187
 
184 188
 * :doc:`The demo site </internals/sandbox>`.
185 189
 
190
+.. _django_support:
191
+
186 192
 Django 1.5, 1.6 and custom user model support
187 193
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188 194
 
@@ -249,6 +255,17 @@ Order processing changes
249 255
 
250 256
 There are changes to order processing methods
251 257
 
258
+Tracking Oscar sites
259
+~~~~~~~~~~~~~~~~~~~~
260
+
261
+Oscar's dashboard now serves a single pixel image from one of Tangent's
262
+servers.  This is included to gather information on which sites use Oscar,
263
+which is an important metric for Tangent, who sponsor Oscar's development.
264
+
265
+It can easily be disabled by setting ``OSCAR_TRACKING=False``.  If you do opt
266
+out, please email the mailing list with any production Oscar sites you are
267
+running.  This will help to ensure investment in Oscar's future.
268
+
252 269
 Minor changes
253 270
 ~~~~~~~~~~~~~
254 271
 

+ 3
- 0
oscar/core/context_processors.py Переглянути файл

@@ -10,5 +10,8 @@ def metadata(request):
10 10
             'shop_name': settings.OSCAR_SHOP_NAME,
11 11
             'shop_tagline': settings.OSCAR_SHOP_TAGLINE,
12 12
             'use_less': getattr(settings, 'USE_LESS', False),
13
+            # Whether to use a tracker gif in the dashboard to call back to one
14
+            # of Tangent's servers.
15
+            'call_home': getattr(settings, 'OSCAR_TRACKING', True),
13 16
             'google_analytics_id': getattr(settings,
14 17
                                            'GOOGLE_ANALYTICS_ID', None)}

+ 12
- 0
oscar/templates/oscar/dashboard/layout.html Переглянути файл

@@ -125,6 +125,18 @@
125 125
             </div>
126 126
         </div>
127 127
     </div><!-- /container -->
128
+
129
+    {% comment %}
130
+        This block includes a single pixel from one of Tangent's servers.  We use the referer header to determine which sites are
131
+        using Oscar.  Since Tangent sponsor Oscar's development, this is an important metric to help justify the investment.  You
132
+        are, of course, welcome to remove this tracker - but please email the mailing list if you have a production site using Oscar.
133
+    {% endcomment %}
134
+    {% block trackerimage %}
135
+        {% if call_home and not debug %}
136
+            <img src="//oscar-static.tangentlabs.co.uk/tracker.gif" style="display:none" />
137
+        {% endif %}
138
+    {% endblock %}
139
+
128 140
 {% endblock %}
129 141
 
130 142
 {% block extrascripts %}

Завантаження…
Відмінити
Зберегти