mirror of
https://github.com/jazzband/django-analytical.git
synced 2026-03-16 22:20:25 +00:00
Rename context var to 'kiss_metrics_properties'; add link to KISSmetrics docs.
This commit is contained in:
parent
56653912f1
commit
ebfebef65d
3 changed files with 10 additions and 8 deletions
|
|
@ -37,7 +37,7 @@ EVENT_CODE = "_kmq.push(['record', '%(name)s', %(properties)s]);"
|
|||
PROPERTY_CODE = "_kmq.push(['set', %(properties)s]);"
|
||||
|
||||
EVENT_CONTEXT_KEY = 'kiss_metrics_event'
|
||||
PROPERTY_CONTEXT_KEY = 'kiss_metrics_property'
|
||||
PROPERTY_CONTEXT_KEY = 'kiss_metrics_properties'
|
||||
|
||||
register = Library()
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class KissMetricsTagTestCase(TagTestCase):
|
|||
'{"prop1": "val1", "prop2": "val2"}]);' in r, r)
|
||||
|
||||
def test_property(self):
|
||||
r = KissMetricsNode().render(Context({'kiss_metrics_property':
|
||||
r = KissMetricsNode().render(Context({'kiss_metrics_properties':
|
||||
{'prop1': 'val1', 'prop2': 'val2'}}))
|
||||
self.assertTrue("_kmq.push(['set', "
|
||||
'{"prop1": "val1", "prop2": "val2"}]);' in r, r)
|
||||
|
|
|
|||
|
|
@ -122,9 +122,8 @@ For example::
|
|||
})
|
||||
return some_template.render(context)
|
||||
|
||||
The output script tag will then include the corresponding Javascript event:
|
||||
|
||||
_kmq.push(['record', 'Signed Up', {'Plan':'Pro', 'Amount':9.99}]);
|
||||
The output script tag will then include the corresponding Javascript event as
|
||||
documented in the `KISSmetrics record API`_ docs.
|
||||
|
||||
|
||||
.. _kiss-metrics-properties:
|
||||
|
|
@ -137,11 +136,14 @@ You may also set KISSmetrics properties without a corresponding event.
|
|||
For example::
|
||||
|
||||
context = RequestContext({
|
||||
'kiss_metrics_property': {'gender': 'Male'},
|
||||
'kiss_metrics_properties': {'gender': 'Male'},
|
||||
})
|
||||
return some_template.render(context)
|
||||
|
||||
The output script tag will then include the corresponding Javascript event:
|
||||
The output script tag will then include the corresponding properties as
|
||||
documented in the `KISSmetrics set API`_ docs.
|
||||
|
||||
_kmq.push(['set', {'gender':'Male'}]);
|
||||
|
||||
.. _`KISSmetrics set API`: http://support.kissmetrics.com/apis/common-methods#record
|
||||
.. _`KISSmetrics record API`: http://support.kissmetrics.com/apis/common-methods#set
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue