Bob Correll
R.I.P. 3/31/2022
One of the hottest threads on the forum.
Folks must be getting board.
Folks must be getting board.

Is the 2" x 4" sitting directly on the sidewalk?Setting it to the footing would be a difficult job. I've got a sidewalk under the gate.
Is the 2" x 4" sitting directly on the sidewalk?
Reason I ask is sidewalks, driveways are a floating slab ( they move up and down depending on the weather)
If your area gets a good cold spell the frost level could heave your sidewalk up an inch or less.( round here we can go more)
If that's the case you are putting more strain on any fasteners, unless you under cut it.
Do the neighbors have to come over and let you out?We have two gates, one like yours with a 2x4 affixed to the house and one with a 4x4 mounted to a footing. Guess which one gives me grief?