Years back the man who build our house had a 10 yr old son (named Andy). The father got a black Lab pup for his son ( they named him Amos). As Amos grew he got no training and would come over to visit causing grief with our pets and birds that were contained. I had conversations with the dad about the dog, but nothing changed. We had 6 acres next to his, were friends, but after several "wish you'd so somethings" I decided to do something myself. Here's my solution.
It was summer time, so I mowed a patch of grass as low as possible. Had a metal pan for changing oil, drilled a couple of 1/8" holes near the top lip, sanded the metal clean. Made three dowels from an old broom handle about 8" long. Took the garden hose and soaked the mowed area good. Put the dowels in the ground, leaving about 1" out, and in a triangular arrangement so the pan would set on them. Put a wire through one hole of the pan and then back through the other hole and wrapped it tight back on the incoming wire. The other end went to my fence charger in the shop. Had my wife make some gravy and add a couple broken up bit of hot dogs.
It wasn't half an hour and 'ole Amos had his nose in that tasty morsel. He yelped all the way home!! He lived the rest of his life as a neighbor, and I don't think he came on our property again.
Jim, the father, heard the screaming dog and called to see what happened. I explained my strategy and told him I hope it kept him home. We remained friends.