The Glenrothes by-election was one that broke all the rules. The SNP started favourites. The growing global financial crisis was an ominous backdrop. Indeed, Alex Salmond was so confident of victory that when asked if he thought his party would win the seat he appropriated Barack Obama’s campaign slogan and boasted: “yes, we can”.

It all looked so predictable. Then Gordon Brown decided to change the rules of the game. He broke the precedent that serving prime ministers do not campaign in by-elections. He campaigned in Glenrothes – to great effect. And even more ground-breaking, in the latter part of the campaign Sarah Brown was on the doorstep nearly every day. Her charm and eloquence as compelling there, as they were when she spoke at Labour party conference last year.

The rest is history – we won and the Glenrothes by-election was a shot in the arm for Labour supporters across the country. In Scotland it showed that the wheels had come off the SNP’s bandwagon. In the broader UK context it showed that the government’s message about the global financial crisis was getting through to our core voters. It’s worth reflecting on the broader political lessons we can learn from winning this seat.

The central issues were the candidate, the campaign and communications. It cannot be said often enough that Lindsay Roy was far and away the best candidate for this seat. All parties know that the choice of candidate is particularly critical in a by-election because of the intensity of the media gaze.

One of the keys to success in promoting your candidate is what is called ‘social proof’ – the fact that the claims that you make for your guy are echoed by significant numbers of the public. From the outset we said that Lindsay Roy was not a run of the mill politician. We were not asking voters to support someone who believed in politics as normal. As a successful local head teacher, Lindsay had shown his ability to deliver for local pupils, their families and their communities. It was that passion and track record of achievement he wanted to put to work for the benefit of Glenrothes town and its surrounding villages. Thousands of voters had a personal connection to Lindsay because he had taught them or members of their family. That familiarity helped, but what clinched the deal was that his offer to campaign on local issues was supported by a track record of excellence and achievement in the schools he had led.

In stark contrast, the SNP chose the leader of the new SNP administration on Fife Council. Their choice led to the campaign focussing on the record of the SNP. And this hurt them badly. The reason was simple – the SNP had been in power long enough in the Scottish government and locally in Fife to give themselves a record. And that record included dramatically raising charges for social care for older people. It is unpopular anywhere to make such a move, but the SNP’s key error was to fail to answer the charge adequately. We publicised the new charging regime which meant big increases for some, and the SNP were caught between denying, defending and explaining the changes. As a result we were able to badge them as acting unfairly.

But the record of the SNP could only become a critical factor because we took control of directly selling our message. Activists and organisers who campaigned in Glenrothes will know the local paper ‘The Fifer’. This was set up by the Labour party for the duration of the campaign and it proved one of the most effective channels of communication we had. Its tabloid style and format made it readable. But it was the content that made it a must read. Stories of real people with problems caused by the SNP council were picked up on the doorstep and then put through doors across the constituency. Once it was in circulation people began contacting the party with more stories. One MP reports that he answered the phone in one of the campaign offices and was asked – “Is that the Fifer? I’ve got a story for you.” We know that direct unmediated communication with our voters is critical. In Glenrothes the campaign was the burning platform that forced us to innovate, but the creation of local news vehicles – whether papers or internet forums– is one to which we should devote far more time.

Finally, the victory was a triumph for the campaign itself. Party organisers came from all over the country – another example of us being stronger together, weaker apart – and they devoted themselves day and night to identifying our vote. Like far too many seats in Scotland we had little useful voter ID at the outset – something we must never let happen again. Our positive attitude was central. I know that winning Glenrothes put a spring in the step of our supporters, but in truth we only won because we went in with our heads up. And it is not only Colin Smyth, the General Secretary in Scotland, and the full time staff who deserve the credit for that. The politicians who ran the campaign established a partnership that should be a model for future campaigns. This was the first time we have run a Westminster by-election in Scotland involving both MPs and MSPs in the leadership of the campaign. It is invidious to single out individuals, but I have to say that the punchy, tabloid–friendly voice of John Park MSP as the campaign spokesperson was essential to getting our message across. Our MPs, MSPs and MEPs together far outnumber the resources the SNP can muster. Having started well, Iain Gray, Labour’s leader in the Scottish parliament, and Jim Murphy, Secretary of State for Scotland, must continue to use that strength outside election campaigns.

All these lessons have, I believe, got application wherever we campaign. But the abiding lesson for me was the one we received on election night when the ballot boxes were opened. There was an assumption in our campaign that the electorate in Glenrothes could be divided between ‘our’ voters and ‘their’ voters – and we sought to identify and get out our vote in what we thought were our strongholds. On the night, the splits showed us that we won 93 of the 96 ballot boxes. There was no reservoir of SNP votes. They were all our votes. Available for us, when we took the time to craft a message, deliver it and follow it up in person. It’s not easy, but it is simple.