Ad networks - people can just disconnect or look away if they like.
Drug trials have benefit to society.
I would argue that creating a system to fire people in an automated fashion when they take too many bathroom breaks like this is morally worse than both of those systems you mentioned.