Wrapped ad code around the ad loading switch