This is a question I got recently. Its a good one because goats that aren't aware that an electric fence will shock them will often walk right through it. If it gets shocked on the way through and bolts forward it just learned that it can beat the fence and you'll be hard pressed to keep it in afterward. The trick I use is the same one I use to keep deer out of the garden. I hang small strips of tinfoil off the fence with a smear of peanut butter on them. The peanut butter will make the goat (or deer) stop and sniff the foil. Maybe even try to lick it. A wet tongue on an electric fence will definitely turn on the porch lights! Ask any kid that ever peed on one! Not something they want to try again! At least for awhile. Some are surprising stubborn (I'm talking about the goats not the kids) but at least they usually approach cautiously and give it the sniff test and don't charge past. Its always worked for us.