You put up a gate before a guest comes over. The guest enters, and your dog still barks from the other side. The gate is doing one job: preventing contact. It doesn't automatically change how your dog feels about a person entering the home. It may even leave them staring at someone they cannot approach or escape.
Move your dog to a comfortable room where they do not have to watch the doorway. Give them water and a safe activity they enjoy. Ask the guest to enter and settle without approaching the dog, talking to them through the gate, or trying to feed them. If your dog calms once the visitor is out of sight, you have found an important piece of the plan.
Practice arrivals without the pressure of a visit
When nobody is coming over, teach your dog to go to their bed in that quiet room. Reward the choice, then release them. Add small versions of an arrival: a family member walking to the door, a soft knock, and later a helper arriving for a short planned session. If your dog reacts, make the sound quieter or keep the helper farther away. A real guest should not be waiting for the training to work in the hallway.
Some dogs can join later once people are seated, others do better staying in their quiet space for the whole visit. Do not force an introduction because the barking stopped. Look for a relaxed body and the ability to move away, not just silence.
If your dog has growled, snapped, or tried to get through a barrier, tell visitors not to approach and seek a qualified, reward-based behavior professional. A veterinary check is important when the reaction is new or worsening. A gate is a useful safety tool, a workable visitor routine is the larger goal. For a longer plan around arrivals, see the visitor and doorbell guide, keep the gate as a safety boundary, not a test your dog must pass
Sources: Dogs Trust: How to prepare your dog for visitors. Dogs Trust: Dog aggression towards visitors.