Once someone I knew planted a small evergreen in the front yard and the neighbour's dog came over frequently to "mark" it. It ruined the poor tree. So she replaced it with a new one, and put an electric fence around it. Wrapped it several times around. When the dog's urine made contact with the electric wire... yip yip yip all the way home. I heard it only took once.