This feels like it should be wrapped in `if (analytics)` too, for consistency at the least