It's pretty hard to get excited about Facebook likes when you've just lost the biggest vote in Scotland's history.

But, as the outgoing head of digital at Yes Scotland, I want to work out the answer to a somewhat vexing question: how come we lost when we had such a huge social media lead over Better Together?

On Thursday night - in a moment that seemed symbolic at the time but simply wasn't - Yes Scotland's Facebook likes overtook those on David Cameron's page just as the polls closed. The vast majority of those 330,000 people were in Scotland. The No campaign had 219,000 at the time. Our reach (the measure of how many people saw our content thanks to their friends) was staggering - several million. Facebook's page comparison tool showed we'd always been far ahead of No in terms of engaging with people.

As polls closed, Yes Scotland had 106,000 followers on Twitter. The No campaign had 42,500. The pattern was repeated across all the other social networking platforms, a valuable avenue of communication outwith mainstream media.

These are big, impressive numbers but they are a tad overshadowed by the small matter of the actual vote, which Yes lost by a shade fewer than 400,000 votes.

I can't pretend that I hung on to the famously positive, optimistic Yes Scotland mindset as the results came in. My team and I had put a huge amount of effort into building our online network of supporters; nurturing and supporting valued allies; creating fantastic, targeted content; and making sure that everyone genuinely connected to the campaign knew how to persuade others in an engaging way.

But to what purpose, I asked myself?

Salvation came in the unlikely person of Lord Ashcroft, whose polling on how people voted showed that Yes had come first in all age groups except the over-55s. That's the age group least likely to use social media.

Our support was highest (59 per cent) among 25-34s - the age group most likely to use Facebook, which had emerged as a key battleground.

While there may be other factors at play, there's surely a correlation between our dominance of social media and that age group's support for Yes.

Social media is the art of getting people to share information. In that, my digital strategy aligned with our grassroots approach exactly. It's a model that will change how elections are fought.

Stewart Kirkpatrick is Yes Scotland Head of Digital