In OTL, the Battle of Saratoga convinced the French to throw their lot in with the Americans.
Suppose General Howe decides to attack Philadelphia by land instead of by sea in 1777. This means he would be occupying parts of New Jersey he had to vacate after Trenton. He then follows one of his original idea of trying to hold land to convince Loyalists that they crown was winning (in OTL he actually made plans for an overland march and considered slowing down to consolidate territory).
Back in Europe, the French decide the American victory at Trenton last year meant the American were going to win the war. They plan an attack on Gibraltar and British holdings in the Caribbean. War is declared.
In the Americas, Burgoyne wins at Saratoga and bags over 3,000 prisoners. He marches over to Albany and waits for his allies to supply him through boats coming from New York. He starts up his plan to use Albany as a base and cut off New England from the colonies (this involves raiding parties and not a static line across the Hudson). A supply boat from New York informs him that they just received word from Europe France declared war on Great Britain, Gibraltar is under attack by the French (but they are failing miserably with no help from the Spanish... yet), reinforcments to Howe has been redirected to the Caribbean Islands (More economically important than the North America), and rumor is that Span might throw their lot in with the rebels too.
When word of Saratoga reaches Spain, would they decide to not intervene, or would they still be gearing up for a fight to take Gibraltar back? Would the Patriots have enough morale to continue the war after getting a butt-whipping (it was New York and now Saratoga and Albany)?