The foam gun is simply a proportioning device. I have always tried to mix/set it so that I get the same dilution ratio coming out of the gun that I would get mixing it in a bucket. Other people have suggested that they don't carefully measure, or, by my calculations, use way more, or way less than recommended dilutions. I used Z7 in the gun for the first time last weekend, and only mixed a small amount, found I was going through it too fast, so I increased the dilution (less shampoo), and it was still fine, so I think that will work with others as well.
The ideal way would be to but undiluted shampoo in the foam gun cup, and adjust your dilution solely by the adjustable metering pin. Unfortunately, since it's a venturi/suction device, and since many shampoos are thick, they will need to be diluted somewhat to draw properly. The Bubble Bath is only medium-thick, so it's not that bad.
I would start with 8oz BB in the cup, with 24oz of water. Then you can set the metering pin to the center position (there are 5 positions, play around with this a little bit first so you don't get confused, they have a sixth, dead hole on one end for the detent mechanism, and the illustration on the side of the jar is not the clearest. The least diluted [richest] setting is with the metering stem pushed all the way to the left, as the gun faces away from you; slide it to the right from one to four clicks to use less solution, and make sure the holes are facing up). So start with the center position (two clicks from wide open), which is 1oz/gallon when you have the above mixture in the cup, and adjust the metering stem left for more soap, right for less. Use more if you have stubborn dirt and you want more lubricity, less if you are having trouble rinsing or are stripping wax.
If you find you are filling the cup too often (and some people pre-mix bottles of diluted mixture so they can just refill the cup without measuring anything), you can try going half shampoo/half water, in which case the 1oz/gallon setting would be the second from the smallest (that's the 2oz/gallon setting on the gun, but you will only get 1oz/gallon of shampoo since you have it diluted by half already in the cup).
Hope this was understandable.