If the main job of an opposition leader is to the win the next election, then the new Labour leader’s first task should probably be to work out why they lost the last one. In late July, YouGov asked a representative sample of the general public whether they agreed with a series of criticisms of Labour in government and which ones they thought contributed the most to Labour’s defeat.

The most widely agreed with criticisms of Labour in government were that they were soft on immigration (76 per cent agreed); that they were too subservient to the USA over Iraq and Afghanistan (74 per cent); and that they had become out of touch with ordinary voters (68 per cent). However, asked what people thought were the main causes of their defeat, the answers were slightly different – people pointed once again to immigration (just over half thought this was one of the main causes), but also to the damage the recession did to Labour’s reputation for economic competence (48 per cent) and Gordon Brown’s own poor performance as prime minister (43 per cent).

If we compare this to how the Labour party’s own members feel about the former government, then, as we’d expect, far fewer agree personally about Labour’s shortcomings. The only criticisms that a majority of party members agree with are over Iraq and Afghanistan, becoming out of touch with ordinary people and not doing enough for ordinary working class voters. Asked why they think Labour lost, party members agree with the public that the effect of the recession was a major factor, but see the other main factors as becoming out of touch with ordinary voters (47 per cent) and failing to do enough to help its natural working-class supporters (44 per cent).

These findings don’t necessarily explain why Labour lost the election; people themselves are not always good at understanding the reasons for their own decisions. But they do point to some differences in attitudes between the public, who Labour’s new leader will need to appeal to, and the party membership, who the new leader will need to keep onside.

The public saw being soft on immigration as a major cause of Labour’s defeat, while relatively few party members either agreed with the criticism or saw it as a major cause. The public saw Gordon Brown as a poor prime minister who was a major cause of the party’s failure; again Labour members disagreed. Conversely, members were more likely to blame Labour not paying enough attention to its working-class supporters than were the wider public.

Do these differences matter? As Gordon Brown has already withdrawn from the political stage the different perceptions of his performance as prime minister are largely academic. While the difference in attitudes between party members and voters on immigration is real, becoming an anti-immigration party is probably not a realistic option for Labour anyway. However much it would appeal to some of their traditional working-class supporters it would also repel the educated middle classes who are also a keystone of Labour’s modern electoral alliance.

Looking at some of the other findings, though, reveals more significant differences. Comparatively few party members chose explanations that might force Labour to seriously reconsider its policies – for example, only five per cent of party members thought that wasteful public spending was a major factor in the party’s defeat, compared to 29 per cent of the wider public, with 59 per cent of voters looking on this as a legitimate criticism of the last government. In the fullness of time, differences like this that may cause real problems for Labour.

One of the first questions the new leader will need to answer is: what narrative do voters attach to the Blair-Brown era? In 1997, the Conservatives claimed they had left a ‘golden economic legacy’, but Labour painted a picture of an outgoing Conservative government that had starved public services of investment and presided over a ‘boom and bust’ economy. It was the latter narrative that convinced the public and did huge damage to the Conservatives’ electoral chances in the decade that followed.

Now it is the other way around: the coalition is placing the blame for cuts squarely on the last government and building up the narrative that the Labour government drove the country to the brink of bankruptcy. YouGov’s polling in early August showed that 45 per cent of people blamed public spending cuts on the last Labour government, with only 22 per cent blaming the coalition. If the government avoids economic disaster this will make up the battleground for the next election, and on public spending there is a wide gulf between how the public see Labour and how they see themselves.

At the same time, Labour shouldn’t spend too much time trying to draw parallels with the Conservatives in 1997. In many ways they are in a much better position. Labour may well be seen as tired, clapped out and out of touch after 13 years of power, but they don’t have the negative connotations that the Conservatives suffered. Whatever their failings, our regular polls show more people think Labour’s heart is in the right place, than they do of the Conservatives or the Lib Dems. Labour is also seen as more likely than the Conservatives to appeal to the whole country, not a narrow section of society.

Labour need to reconnect with the public, find some new narratives and policies to offer, and find a way to make themselves relevant after the spending cuts have been made. But they don’t need to detoxify themselves in the same way as the Conservatives did. They are not a new ‘nasty party’.

As to which leader will have the job addressing these questions, YouGov polled party members and members of affiliated trade unions at the end of July and found it was a close race between David and Ed Miliband. At the time David Miliband was narrowly ahead of his brother, with Labour members evenly divided between David and Ed, and trade unionists and MPs (thanks to data collected by Left Foot Forward) splitting in favour of David. Of course, the poll was conducted long before ballot papers are sent out, before many trade unions had encouraged their members to vote for Ed and relied upon a lot of guesswork when it came to MPs’ second preferences. The best we can conclude is that the next leader of the Labour party will be a Mr Miliband.