This is context, not hypocrisy, and the window and the gate are two different worlds to your dog. Through glass, a delivery driver is a fast-approaching stranger on your dog's core territory who never quite arrives. At the gate, that same human is a complete, smellable person met socially with you standing there. Many perfectly sociable dogs keep both behaviors for life, because each one is reinforced in its own setting.
The Window: A Barrier, a Stranger, and a Perfect Rehearsal Loop
Barriers are emboldening. A dog behind glass, a fence, or a lead can bark at full intensity with none of the consequences a face-to-face meeting would bring, and arousal climbs precisely because the interaction can neither complete nor be escaped. The window also frames the event theatrically: the van stops, the driver strides up the path toward the house, packages in hand, looking at the door. From inside, that is an approach on the home itself, repeated by different strangers in similar uniforms several times a week.
Then comes the part that cements the habit: the driver leaves. Every single time, barking is followed by the intruder retreating, which, from your dog's side of the glass, means barking worked. A behavior rehearsed that often, with that reliable a payoff, becomes the automatic response to a van slowing outside, long before the driver is even visible.
The Gate: Scent, Company, and a Completed Greeting
At the gate the picture changes in every way that matters. There is no glass between your dog and the person, so your dog can do what dogs actually do with people: catch the scent, read posture and movement, and decide based on full information. You are present and relaxed, which your dog reads as social evidence that this person is acceptable, and the greeting completes normally, a sniff, a wag, perhaps a fuss, and then everyone moves on. Nothing is frustrated and nothing is defended, so the friendly dog you see at the gate is your dog's unimpeded social self, not a performance.
Cut the Window Rehearsal, Keep the Gate Manners Safe
Reduce the window habit by reducing the rehearsal. Block the sightline at dog height with film on the lower pane or by rearranging the furniture your dog stands on to watch, close off the watching room when deliveries are due if you can predict them, and reward the new behavior you want: hearing a van, looking at you, and settling on a mat for a chew. Interrupt early and calmly rather than shouting over the barking, which sounds to your dog like enthusiastic joining-in. If the doorbell or a knock is the trigger, practice the mat settle with household members knocking at quiet times, so the skill exists before a real delivery tests it.
Keep gate greetings as good as they look by managing them, too: meet drivers with your dog on a lead, let the driver choose how close to come, and do not let a bouncy dog rush a person carrying parcels, however friendly the intent. Friendliness at the gate never obliges a stranger to enjoy it. If a regular driver is willing, a treat handed over by you rather than thrown by the driver can keep that friendly association without teaching your dog to mob every arrival at the gate. With KinsLe Care Teams, you can assign the delivery routine as a shared household duty, the mat settle and quiet reward practiced the same way by everyone, each session marked complete with a timestamp, so one person's training is not undone by another person's shouting.