Gates that swing out towards the street present a serious problem for latches. If you mount the latch on the gate itself, it will not work unless you install it on the street side. Out on that side it is simply not secure. If you mount it on the fence, then the shaft that catches the gate is always catching you as you pass by -- an annoyance for us big folks and a danger for little ones that see that catch at eye level. As a matter of fact, most fence hardware has a shaft sticking out someplace to catch you as you go by, either on the fence or on the gate itself.
Here is a DIY privacy latch that retracts into the fence, leaving no shaft on either the gate nor the fence to catch anyone. In addition, when installed high on the fence it becomes rather difficult for people to open who don't know the "secret" and a true barrier for smaller neighbour kids that perhaps need to be kept out because of a swimming pool or other dangers in the back yard.
It is nothing more than a couple of pieces of horizontal wood placed between the fence boards in such a manner as to cradle a 2x2 moving piece. A 3/8" metal rod is installed in the end of the 2x2, becoming the latch that moves into a hole in the side of the gate to hold it shut.
What becomes very interesting is that on the public side, it just looks like a lot of wood structure with a stray screw sticking out. To make it secure, hidden behind one of those fence boards is a vertical shaft that floats on the 2x2 until it reaches its closed position -- where it then drops down and locks the 2x2 into the closed position. To open the gate you have to both lift the out-of-sight drop pin, and slide the shaft -- something that is beyond smaller children, particularly when all of this is built fairly high on the gate. On the private side of this gate I actually use a couple of larger drawer handles to make it easy on this side to open and close the latch.
One special little addition is a hole that you can see next to those drawer handles that goes through the 2x2 at 45 degrees and into the support board below it. When I drop a nail into this hole while the gate is in the closed position, it locks the shaft closed, even if you lift the regular shaft. This is my vacation lock. Now you really have to climb over the fence to figure out how to open it -- locking out even those who thought they know how to get through.
Make the 2x2 so it floats easily in its socket and oil it thoroughly with something like FluidFilm to minimize its expansion in rainy weather.
Use a fairly small gate stop on the fence post just behind the latching shaft. Frost in fences and gates often thrown them out of line every year and minimizing the stop makes line-up for the gate to catch easy to adjust.
The first year or two you will probably have to make the shaft receiving hole in the gate itself a bit higher or lower, making it oblong. That is no real problem. Just adjust the hole and the stop anytime things get sticky.
Almost every tradesperson who has been blocked by my gate latch stops and takes photos of it so they can make one like it -- so finally here it is, complete with a little video to help you build your own.