I don't know how to training an outside dog. Most dogs have to be caught in the act. I do know one thing, I would never spank a dog, I don't care what he did. If something was so bad that I had to spank him, I would rehome him. There are families that are willing to training a dog properly but spanking is not it.
You could probably take him, on leash, to the area you want him to go in. That takes a lot of attention and you have to know his routine.