Add event deduplication via id and timestamp params#125
Merged
hownowstephen merged 5 commits intomainfrom May 9, 2026
Merged
Conversation
Change track() and track_anonymous() to accept a data dict instead of **kwargs, with optional id and timestamp keyword arguments. The id parameter accepts a ULID for event deduplication. The timestamp parameter sets the event time (epoch seconds). Invalid timestamps are silently dropped. Passing data=None sends an empty data dict. This is a breaking change: callers must switch from keyword arguments to a dict for event data attributes. Refs #98
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4efee3b. Configure here.
joeybaer
approved these changes
May 8, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
track()andtrack_anonymous()to accept adatadict instead of**kwargsidparameter (ULID) for event deduplicationtimestampparameter (epoch seconds) for explicit event timingdata=Nonesends empty data dictThis is a breaking change — callers must switch from keyword arguments to a dict for event data attributes:
Mirrors the approach taken in customerio/customerio-ruby#136. Refs #98.
Test plan
idpresent in request body when provided, absent when notidabsent when not providedtimestampset as top-level field when providedtrack()with no data sends empty data dicttrack_anonymous()with id and timestampNote
Medium Risk
This is a breaking API change to the public
track()/track_anonymous()signatures that will raiseTypeErrorfor existing keyword-attribute callers. It also changes event payload shape by introducing optional top-levelidandtimestamp, which could affect downstream deduplication/timing behavior if misused.Overview
Adds support for optional top-level event
id(for deduplication) andtimestamponCustomerIO.track()andCustomerIO.track_anonymous().Breaking change: both methods now require custom event attributes to be passed via a
datadict (instead of arbitrary**kwargs), defaulting to{}when omitted; invalidtimestampvalues are silently dropped.Updates the README/CHANGELOG and expands tests to enforce the new call signatures and validate request bodies for
data,id, andtimestamp.Reviewed by Cursor Bugbot for commit e575fbe. Bugbot is set up for automated code reviews on this repo. Configure here.