State-based ad counter