Your dog should be conditioned to the clicker and it should be reinforcing to him/her. You can do that by:
It’s always best to have as few distractions around as possible, but you can do this anywhere.
Toss the treats in front of your dog unless he/she is lying down. If your dog is relaxed on the floor, put the treats right in front of his/her mouth so he/she will remain in the relaxed position. This is what we’re after!
Practice this for 5-10 minutes when the situation presents itself (for example, a guest comes over). Be sure your dog is on a leash so he/she cannot harass your visitors, and ask permission in advance. If someone doesn’t want to participate, put your dog away in a back room.
Set up a scenario where your dog is struggling but not totally out of control, and practice for 5-10 minutes, 3 or 4 times each week.
When you finish this exercise with each trigger, that trigger should be less exciting to your dog. Work new triggers as they present themselves.