Skip to content

Support for event deduplication#98

Closed
joandvgv wants to merge 1 commit into
customerio:mainfrom
joandvgv:main
Closed

Support for event deduplication#98
joandvgv wants to merge 1 commit into
customerio:mainfrom
joandvgv:main

Conversation

@joandvgv
Copy link
Copy Markdown

Hi all! I noticed the current track event is not sending the id as part of the payload so the event deduplication feature is not working.

This should do the fix, am I right?

Can update formatting or attend any request from repository owners if this PR makes sense.

Thank you!

@newhook
Copy link
Copy Markdown

newhook commented Jul 3, 2023

Hey Joan , thanks for the PR. However, won't this break existing code which passes "id" as part of the data payload? For example, consider:

cio = CustomerIO(site_id, api_key, region=Regions.US)
cio.track(customer_id="5", name='purchased', id='item_47', price=2.25)

hownowstephen added a commit that referenced this pull request May 9, 2026
* Add event deduplication via id and timestamp params

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
@hownowstephen
Copy link
Copy Markdown
Contributor

closing in favour of #125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants