I agree a visit to the vet is in order. Onions are poisonous to dogs and the high fat content of the burger might cause colitis issues as well.
 Pets and Onions  Canine Colitis 
Hope you dog feels better. Best wishes
My vet has given this to help bind the poo. You make white rice using 4 times the amount of water and let it cook until you get a white liquid basically rice water paste. After the rice water cools you give a little paste. This will help bind (firm up the poo) also apple without the skin. The apple pectin binds as well. But you should find out if there is a more serious issue first by going to your vet.