A man who stalked a woman and placed a tracking device on her car has been told he will avoid jail time.