SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Filter Duplicate Events from Browser and Server in Segment

Issue

You are experiencing duplicate events within Segment that are sent to downstream destinations because the tracking event is triggered simultaneously from both a browser library and a server-side library.

 

Product

Twilio Segment

 

Environment

Segment Console

 

Cause

This duplication happens when the same event name is implemented across multiple connected tracking sources or libraries. By default, Segment routes all successfully tracked events from every source to your enabled destinations unless a filter explicitly stops them.

 

Resolution

You can eliminate duplicate events by creating a Destination Filter that checks the context.library.name field to block browser-side tracking while allowing server-side tracking to pass through.

Follow these steps to configure your Destination Filter:

  1. Log in to your Segment workspace.

  2. Navigate to Destinations and select the destination receiving the duplicate data.

  3. Click the Filters tab and select Add Filter.

  4. Define the filter criteria to identify the browser library:

    • Select context.library.name as the property.

    • Set the operator to equal the library, such as analytics.js.

    • Add additional logic as needed.

  5. Set the filter action to drop or block the matching events.

  6. Save and toggle the filter to active status.

 

Additional Information

Using Destination Filters allows you to manage data delivery dynamically on a per-destination basis without needing to modify your deployed application source code.

 

Have more questions? Submit a request
Powered by Zendesk