Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for event deduplication #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions customerio/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,14 @@ def identify(self, id, **kwargs):
url = self.get_customer_query_string(id)
self.send_request('PUT', url, kwargs)

def track(self, customer_id, name, **data):
def track(self, customer_id, name, id=None, **data):
'''Track an event for a given customer_id'''
if not customer_id:
raise CustomerIOException("customer_id cannot be blank in track")
url = self.get_event_query_string(customer_id)
post_data = {
'name': name,
'id': id,
'data': self._sanitize(data),
}
self.send_request('POST', url, post_data)
Expand Down Expand Up @@ -220,4 +221,4 @@ def _build_session(self):
session = super()._build_session()
session.auth = (self.site_id, self.api_key)

return session
return session