I agree with Grant Shapps: last week's by-elections put Ed Miliband one step closer to No 10. If you read some of the media coverage of the by-elections, you might have been forgiven for thinking that Labour had been beaten in Heywood & Middleton and that the Tories had won in Clacton.

Let's be clear: David Cameron didn't just lose in Clacton - he suffered a humiliating defeat. The Tories fell apart quicker than a Ukip policy announcement. And it wasn't for lack of trying. At least 10 members of the Cabinet went campaigning in Clacton. Just a week after David Cameron confidently predicted "we are taking this election very seriously - we can win this", he got his backside kicked. He lost with the Tories’ biggest drop in share of the vote in any by-election in two decades.

Just as importantly, he lost after he'd played his biggest anti-Ukip cards: his EU referendum pledge; the promise to scrap the Human Rights Act; the unfunded tax cuts (from a man who once said "you can’t talk about tax reduction unless you can show how it is paid for, the public aren’t stupid"); the squeeze on working age benefits for three million working people, whilst keeping his donors happy with his tax cut for millionaires.

For about 48 hours, the ludicrously fawning Tory-supporting media were talking excitedly about Cameron's post-conference polling surge. They've stopped now. The Tories losing Clacton would be like Labour losing a seat like Islwyn, North Durham or Leigh.

Clacton was a political earthquake. The Tory defeat to Ukip in Clacton follows defeats to Labour in the local elections in May in the battleground seats that will decide the general election next year: a list that includes places like Amber Valley, Croydon, Carlisle, Weaver Vale, Lincoln and Ipswich. Also on that list is Crawley, where on Thursday, in an important council by-election which was perhaps overshadowed by events elsewhere, Labour won back a seat from a Conservative councillor who had defected to Ukip.

And contrary to the media myth of equivalent pain for the main parties at the hands of Ukip last Thursday, Labour's result in Heywood & Middleton is actually in contrast with the Tories' result in Clacton. In both seats there was a strong Ukip challenge. But in Clacton, the Tory vote collapsed. In Heywood & Middleton, the Labour vote held firm – in fact, it increased slightly. Ukip increased its vote, but largely at the expense of the Tories and Lib Dems, who went from 50 per cent of the vote between them in 2010 to just 17 per cent between them now.

Our victory has followed a concerted effort by Labour to take Ukip and expose them for what they are: more Tory than the Tories. Like their plans to privatise the NHS, abolish workers' rights, increase bankers' bonuses, cut taxes for millionaires. Their top people are overwhelmingly ex-Tory, from their ex-Tory leader, deputy leader and treasurer; to their two ex-Tory MP defectors; to their Heywood & Middleton candidate who admitted during the campaign that he'd personally voted Tory for many years. And their money comes from ex-Tory donors – in the last quarter almost 90 per cent of their funding came from people who used to bankroll the Conservative Party.

We took this message to the people of Heywood & Middleton, with hard-hitting campaign materials showing the Ukip threat, as well as keeping our focus on saving the NHS and standing up for working people. The result was closer than we would have liked, but the fact is the Labour vote held firm. In football terms, Heywood and Middleton wasn't pretty but we did take all three points. And teams that win the league sometimes have to scrap for a win.

We know that when it comes to taking Ukip on in Labour areas, we have continued work to do. We have the right arguments and many of the right campaigning materials. But we now need to have the confidence to go out there and take the fight to Ukip wherever they pose a threat.

But the Tory collapse at Ukip's expense tells you something else: David Cameron's party is falling back in the areas where they need to hold firm and then make progress. Before the last election, David Cameron said: "If we can't win in the north west, we can't carry the country". He didn't win in the north west. He fell back badly. Every Tory MP in a marginal constituency in the north west – and there are plenty – will have looked at the result in Heywood & Middleton and shuddered.

So don't believe everything you read from the Conservative-supporting commentariat (or some of the doom-and-gloomers on our own side). Ed Miliband is the eternal warrior against complacency, but we equally we should have confidence. For once, let's all agree with Grant Shapps when he said that the by-election results "put Ed Miliband one step nearer to No 10". For the sake of the country, let's keep working together to make sure he's right.