In early 2015, flower crowns started appearing on Ed Miliband's head. Petals and hearts were photoshopped on to the then-Labour leader by the "Milifandom", a movement of young, mostly female, voters sharing romanticised images on Twitter to protest against Miliband's "distorted media portrayal".

It was the brainchild of Abby Tomlinson, a 17-year-old sixth-form student, who came to the defence of the man she called "Milibae". The hashtag #Milifandom trended. Then Labour lost the 2015 election.

This prompted David Cameron, whose Conservatives increased their number of seats, to boast: "Britain and Twitter are not the same thing." Tomlinson later told me that having her hopes of Milibae in No10 dashed had made her a "political pessimist", after realising winning over voters online "doesn't happen in a day, a week or even months, it's going to take years".

More than a decade on and she is again using social media to big up a Labour leader, but this time in the heart of government. She sits in the press office in No 12 Downing Street as head of content for Andy Burnham. The government has spent the last few weeks recruiting producers, videographers and strategists, working out of both Whitehall and No 10 North in Manchester.

In his first month as PM, Burnham posted more than 50 times on Instagram, ranging from meetings with world leaders, campaigners, farmers and influencers, to meme-based content like ranking pub snacks with Chancellor John Healey as part of an announcement on business rates. Strategists believe Instagram and TikTok can play to Burnham's communication strengths and sense of humour.

They're all at it, of course. Videos of Conservative leader Kemi Badenoch tearing into the budget or mocking ex-PM Sir Keir Starmer have gone viral. Reform UK's Nigel Farage has by far the biggest online audience of any UK party leader, with 7.6 million followers across Facebook, Instagram, X, TikTok and YouTube.

In Scotland, the SNP have long mobilised their online army to campaign for independence, building a following larger than that of the Lib Dems, which campaigns across Britain, whose leader Ed Davey has achieved some success with campaign stunts going viral.

Restore Britain, founded by former Reform MP Rupert Lowe, enjoys its highest level of support among users of X. The platform is owned by Elon Musk who has publicly endorsed the party, expanding its reach.

Plaid Cymru, newly installed in government in Wales, is still experimenting with its approach, using First Minister Rhun Ap Iorweth in "fun" memes while also posting more serious interview excerpts. The Greens' Zack Polanski has made much of running his own accounts, though as he has found in recent weeks, this comes with risks too.

So how much is enough? In a world where reputations can be made (or broken) with one comment or collaboration, getting the balance right is tricky â being accessible, authentic and approachable, without being cringe. And does it make any difference to elections?

Bring on the hashtag coffee

Cameron's successor, Theresa May, was similarly doubtful about the merits of social media. When she took office she rebuffed aides who suggested she start tweeting: "People don't say 'pass me the hashtag newspaper, or I'd like a hashtag coffee'." Announcements were to be made formally. When cabinet ministers were appointed in May's first reshuffle, it was heralded in press statements beneath the UK government coat of arms.

By contrast, this summer, presenting my 5 Live show from Downing Street during Burnham's first reshuffle, I could predict the appearance of another new minister because the two-person social media team from No 10 would move into position to capture the new arrivals on their cameras.

Of course, prime ministers (and wannabes) have long adapted to new technology. Winston Churchill harnessed the power of radio, but thought television a vulgar diversion. In the 1960s, Labour's Harold Wilson modelled his TV campaigning on JFK in America. In the 1990s, and 2000s leaders like Tony Blair were just as likely to be found on the chatshow sofa as on the Today programme.

Now, podcasts give long-form - and less combative - opportunities to connect with voters, while social media gives a quick hit of direct democratic dopamine.

Peter Hyman, a former adviser to both Tony Blair and Keir Starmer when in Downing Street, said the success of Burnham's early digital output was about "quantity as well as quality".

"You have to narrate the story of what you are doing three or four or five times a day so that you are out there regularly," Hyman said. "Keir Starmer wasn't out there enough and therefore it wasn't landing."

There is a causality dilemma here. Is Burnham more popular in the polls because he is racking up the likes on social media, or is he doing better online because people like him?

Not everyone is convinced. Cody Dahler, a comedian who posts sweary political explainers to his two million followers, warns voters will become cynical if they sense politicians are just using social media simply "as a comms tool". Burnham, Dahler told me on Newsnight, comes across like a "cool substitute teacher".

And after Burnham released a video discussing what a bread roll is called in different parts of the country â barm, cob or bap - to promote his plans for devolution, broadcaster Piers Morgan asked him to "stop wasting your time and ours with these cringe videos".

And therein lies the difficulty of striking a balance. Bea Timpson, a former press secretary to Liz Truss and Rishi Sunak who says she prefers "trad media" like broadcast and print, added: â"I have to accept that it's now non-negotiable to be online a bit, but you definitely can be too much."

The arms race for audiences

TV and online websites remain the most used sources for news, but more and more of us say we also get news from social media, according to media watchdog Ofcom. While this is highest among 16-24 year olds at 78%, a majority of adults in every age group use social media to access news, apart from the over-65s. Even among over 75s, 22% find out what is happening in the world from social media. For politicians, this is no longer just about reaching young people â this is all voters.

Some platforms are more important than others. Even after Elon Musk's conversion of Twitter into X, you will still see MPs, spin doctors and journalists in the Westminster village scrolling through the platform, but digital strategists say "real voters" are found on other platforms. The main parties have far more followers on Facebook (four million combined), which is much more widely used overall, than X (where they have a combined 3.2 million).

Politicians have always looked abroad for policy and campaigning ideas, and social media is no different.

Those on the right seek to emulate the impact Donald Trump has on TruthSocial, while left-wing politicians look to the success of Zohran Mamdani becoming mayor of New York.

Some have even imported social media experts from overseas. In 2019 Boris Johnson hired New Zealand duo Ben Guerin and Sean Topham to run the digital campaign for the general election. They imported into UK politics the concept of "shitposting", releasing deliberately bad images in order to generate a reaction. This included posting a tweet featuring the slogan "Get Brexit Done" in Comic Sans, a font loathed by graphic designers.

There was a method in the madness. "People are more likely to engage with something if they feel like it's been written by a human, not by a committee of design experts," Guerin told me. "It's pretty easy to go viral for doing something weird and wacky, but that doesn't always advance the objectives of your campaign."

This seems to be borne out by some recent hits. Burnham's TikTok post rating pub snacks attracted a million views. Yet a less gimmicky video, straightforwardly listing the five things he said he had done in his first week as PM, got five million.

Spoiling the magic?

There is an inherent tension in political social media. Authenticity is key. Yet who really expects the prime minister to be shooting and uploading his own content?

Back in 2013 I wrote a story about how Cameron's Twitter account had favourited a tweet mocking William Hague from an account handle that made a crude joke about former Tory MP Norman Tebbit being injured in the Brighton bombing.

The prime minister's director of communications called me to complain about my "slapdash and crappy" reporting. My crime? Including a sentence which allowed for the possibility that someone other than Cameron had clicked on the like button by mistake. This would, apparently, spoil the magic for those that thought the prime minister was running his own account for his 500,000 followers.

We now know that Zack Polanski does indeed have his own log-ins. The leader of the Green Party in England and Wales faced criticism in May for sharing a post condemning police actions in the Golders Green attack, for which he apologised. Then in July he accepted an Instagram collaboration which included a man wearing a T-shirt featuring a cartoon guillotine and the song lyrics "we're only making plans for Nigel". Reform UK said it amounted to incitement of violence against Farage. "I'm accepting my responsibility in that I shouldn't have accepted that collaboration," Polanski said, but refused to apologise.

Reform UK's Gawain Towler, a long-time media adviser to Nigel Farage, says: "âMy big takeaway is: don't be a berk on social media, âwhich I think was Zack Polanski's big takeaway too."

Dov Forman, who helped Tory-turned-Reform MP Robert Jenrick grow his following from 20,000 to more than half a million with viral clips including confronting fare dodgers on the London Underground, says it is "risky" for a leader to run their own social media. But sometimes it can be a risk worth taking.

Badenoch has taken to directing her own videos, telling aides what she wants to post. She has attracted backing on X from American rappers Nicki Minaj and Azealia Banks. Those are the sort of authentic third-party endorsements politicians crave.

Up the ladder

On the day he became prime minister, a video was released of Burnham being interviewed on the Career Ladder, a series run by Ukrainian TikToker Max Klymenko who interviews guests about their career, while standing on a ladder. "If they personally haven't seen the channel it's sometimes quite difficult to make sense for them," Klymenko says. Burnham had seen the show, and did use the ladder.

Which leads us to the big question: Does any of this actually work? Emma Connolly, an academic who has researched this at the Digital Speech Lab at UCL, isn't sure. "We don't necessarily have really strong evidence or convincing evidence that it could really persuade or transform the opinion of opponent voters or even those that are undecided," she says.

More from InDepth

And this in turn raises the question of how long the Burnham digital honeymoon might last. Can a prime minister TikTok his way through a war, terror attack or controversial court case? Announcing a new giveaway may go viral, but what about the details of the cuts to pay for it?

The truth is none of this is new, as Hyman explains: "The politicians who get this wrong think that social media is now the only place to be, and a substitute for doing the hard work and the heavy lifting of actually getting the right policy, getting the right narrative, and telling that story properly," he says. "Politics is about winning arguments."

After all, politicians have always wanted to be liked. It's just these days they can see it instantly if you hit that heart button on your feed.

Listen to Matt Chorley live from Westminster, weekdays from 14:00 on BBC Radio 5 Live.