Other methods if you can't pre-treat are:
wet sponge it off immediately (but i'll be honest a few times that's not been 100% effective for me as some glue still got into the grain)
Let the glue set hard, then gently scrape off with a chisel, paintscraper, stanley blade at low angle
line the mating surface edges with masking tape so any squeeze out goes onto that instead, good for veneers and the like whereby scraping may cut through it, and wiping wet might raise the grain too much.
Other glues may require different approach - resin based (cascamite) should be wet wiped off right away as it sets hard and is a bugger to scrape off.
Poly based expanding / foaming glue (dark brown clear stuff looks like treacle) - LET IT SET!!! long as you can leave it and scrape or do the lining method - if you try to wipe off you'll be sorry; if you aren't sure if it's set just lightly touch it, if it bounces it's still gloopy and will make a helluva mess. (and wear gloves or you'll have black marks on your hands for days!)
another handy tip is cascamite powdered resin glue can be dyed with powders / colour crystals so it doesn't show up half as much if some goes where it shouldn't.
oh and you could try mixing some of the waterbased stain in a small pot with the glue and brush on joints, that would probably do the same as the cascamite dye trick.
hope that helps