I like using the Elmer's School Washable purple glue stick. All one has to do is give the purple glue stick a little tap on the fabric and you can see where the glue is and place your other fabric (batting) on top of it and and move on to the next section just as you would with pin basting. You don't need to have a continuous line of glue and the purple dries clear. Once dry, no problems with clogging machines.
When using it for applique I place a little dab (really it is just basically touching the glue stick lightly to the fabric just so you can see the purple) then I iron over the spot so it is instantly dry and the fabric doesn't shift as I applique around the shape.