Blog

Introducing Snowplow JavaScript Tracker v4: Enhancing Performance, Simplifying Tracking, and Improving APIs

By
Matus Tomlein
&
Daniela Howard
October 29, 2024
Share this post

We’re excited to announce the release of Snowplow's JavaScript Tracker v4, which delivers a 3x performance boost in event tracking speed, introduces modern web capabilities through Fetch API integration, and provides enhanced control over data collection through new filtering functionality. 

The Evolution of Digital Analytics

The ability to capture and analyze user interactions with precision and granularity is essential, enabling companies to power everything from customer experience optimization to marketing and revenue attribution. However, with Google's recent shift to Interaction to Next Paint (INP) as a ranking factor, organizations face increasing pressure to balance website optimization not only for customer experience and engagement, but also search engine performance, or "SEO". 

Introducing Snowplow JavaScript Tracker v4

The new JavaScript Tracker v4 brings significant improvements to speed and reliability. By adopting the Fetch API and optimizing cookie handling, we've achieved 3x faster event tracking while enabling requests to persist beyond page transitions. The release also introduces streamlined APIs for form and link tracking, enhanced global context management, and new filtering capabilities—all designed to make data collection more efficient and flexible.

Key Highlights of the Release

1. Performance Improvements of Track Calls

With Google now using Interaction to Next Paint (INP) as a ranking factor, responsiveness is critical for both customer experience and for search engine performance. In response, we’ve optimized the tracker to minimize any delays caused by tracking calls.

One area we focused on was cookie management, which previously took up a significant portion of the tracking time. By switching to asynchronous cookie handling, we’ve cut down the time it takes to track events.

The results are significant: tracking 100 events now takes just a third of the time compared to the previous JavaScript tracker v3.

2. Streamlined Request Handling with the Fetch API and Keepalive

The core of the tracker has been modernized by replacing the older XMLHttpRequest with the Fetch API, aligning the tracker with contemporary web standards. This change introduces two major benefits:

  • Keepalive support: Fetch API’s Keepalive option allows events to be sent even when users navigate away from the page, preventing data loss during page unload scenarios. It acts as a more reliable alternative to the traditional beacon method.
  • Simplified Node.js integration: Since the Fetch API is supported in Node.js environments as well, we’ve streamlined the setup process by eliminating the need for third-party HTTP libraries. The Node.js tracker is now easier to configure and instrument in apps.

3. Enhanced Media Tracking: Improved HTML5 and YouTube Plugins

Our HTML5 and YouTube media tracking plugins have received significant upgrades to leverage new media event schemas. These improvements enable the tracker to capture richer and more precise metrics for media playback. The updated schemas also integrate seamlessly with our media dbt package, helping you derive deeper insights from your media data.

4. Simplified Link Click and Form Event Tracking

We’ve made tracking common interactions like link clicks and form submissions even simpler. With event delegation and global event listeners, you no longer need to manually call refreshLinkClickTracking or refreshFormTracking after page updates. This enhancement makes your tracking setup cleaner as it now only requires a single call to enable link click and form tracking.

5. Advanced Event Control with the New Filter Function

Snowplow JavaScript Tracker v4 introduces a powerful new filter function that gives you greater control over which events are tracked. You can now define custom logic to decide whether an event should be tracked or ignored, enabling advanced use cases such as event sampling, edge analytics, or forwarding specific events to other tracking systems.

Try it Out Today

The new JavaScript Tracker v4 is available immediately for all Snowplow customers, delivering improved site performance for better customer experience and SEO rankings, enhanced data quality through modern architecture, reduced implementation costs with simplified setup, and future-ready analytics supporting emerging web standards.

Existing customers can now upgrade using our comprehensive migration guide. If you’re new to Snowplow and want more information about our JavaScript Tracker v4, schedule a demo today.

Additional Resources

  • Technical Documentation: here 
  • Migration Guide: here
  • Release Notes: here
Subscribe to our newsletter

Get the latest blog posts to your inbox every week.

Get Started

Unlock the value of your behavioral data with customer data infrastructure for AI, advanced analytics, and personalized experiences