Unit tests for analytics internal API