Browse files

Merge pull request #1 from neevor/master

Updated to add set api call.
  • Loading branch information...
2 parents 98c6e94 + 674df56 commit 91d57b04af1d346ee086230fbb895b64877ecb94 Daniel Gross committed Nov 29, 2011
Showing with 15 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +14 −0 src/greplin/tornado/kissmetrics.py
View
1 .gitignore
@@ -0,0 +1 @@
+*.pyc
View
14 src/greplin/tornado/kissmetrics.py
@@ -29,6 +29,7 @@ class Kissmetrics(object):
BASE_URL = 'trk.kissmetrics.com'
KM_EVENT = 'e'
KM_ALIAS = 'a'
+ KM_SET = 's'
def __init__(self, api_key, user_id=None, use_https=True):
@@ -76,6 +77,19 @@ def event(self, name, **params):
self._call(self.KM_EVENT, params)
+ def set(self, **params):
+ """Set properties on a person without tracking an event.
+
+ example: self.set(test_name="testA")
+ This will assign the property "testA" to the user identified by self._user_id.
+ This property can be used to segment your visitors when viewing reports.
+ """
+ params = params or {}
+ params['_p'] = self._user_id
+ self._call(self.KM_SET, params)
+
+
+

0 comments on commit 91d57b0

Please sign in to comment.