Why My Analytics Was Logging Every Page Visit Twice (And How I Fixed It)

· Vicente G. Reyes · June 1, 2026, 2:01 a.m.
Summary
This blog post describes a developer's experience debugging a double logging issue in a custom analytics system integrated into a Django REST API and React frontend. Initially suspecting React StrictMode's behavior as the cause, the author ultimately discovers that a full component remount resets component-level state, leading to duplicate API calls. The solution involves moving deduplication logic to a module-level variable to avoid dependency on component lifecycle, thus simplifying the tracking implementation in the frontend code.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →