ditto. I put up a livestock electric fence around the garden. She will hit it once in the spring and then I turn it off but leave the wire up. She will tear ass out to the garden when a bird or squirrel is around, but pulls up to a screeching halt at the wire. Works good, critter defense and no trampled plants.
I have been known to put up a piece of wire (not connected to anything) to dissuade other bad doggy habits.