ON Brexit night, when the hastily organised protest group Glasgow Loves EU called for its troops to assemble at the Donald Dewar Statue on Buchannan Street, the hashtag that brought them together was already flickering across Europe reminding capital cities across the continent that Scotland was not complying.

They gathered with great coats, beanie hats and the warmth of change, armed with torches and iPhone lights, but for reasons of health and safety, not naked flames. They came to remind the world that Scotland is European. As they sang together, they gathered in Aberdeen, Edinburgh, Berlin, Paris and – in a now highly contested light display on the EU building – in Brussels. It began as a line in Alyn Smith’s valedictory speech in the European Parliament, when the grim realities of Brexit began to materialise. The metaphor of a light being left on to help Scotland find a way home in the dark captured the imagination at home and abroad and so the hashtag #leavethelightonforScotland became a viral flicker that could not be easily put out.

Scotland’s pleas to remain a European nation were never likely to “break the internet” nor become one of social media’s electric moments. But it had an impact, and jolted many people out of the torpor of inevitability, giving us hope in the darkness. In a world of forgettable memes, mountainous trivia and tribal spats, Scotland’s light beamed from websites to the real world and allowed a spirit of civic disenchantment to bind people together in common cause.

The hashtag is at its best when it makes that critical journey from the internet to the real world. When they exist only as lame sloganeering or as part of a viral marketing campaign hashtags it leaves me cold, but when they dare to dream and reach out to the streets, the city squares and the picket lines, they take on a real and unique purpose. I like hashtags and I loathe them in equal measure.

Although the origins of the hashtag are complicated, conventional wisdom now accepts that the hashtag was the work of one man – a product-designer at Twitter called Chris Messina. Back in 2007, Messina was working away on the group organising frameworks of Twitter, seeking to increase both the reach and the scale of its community.

The hashtag was one of the few symbols on a computer keyboard that lay dormant and underused, and Messina began to imagine it as a friendly aggregator. He pitched the idea to his bosses and, like many corporate innovators before and since, he was largely ignored. Twitter feared the idea was too “nerdy” and didn’t envisage ordinary people using such a function.

Then Messina had an unexpected breakthrough. In October 2007, firefighters battled a series of deadly wildfires that scorched tens of thousands of acres around San Diego in Northern California, burning down thousands of buildings and leaving at least 42 people dead with hundreds more unaccounted for. One of Messina’s friends was caught up in tragedy and as a favour Messina asked them to attach the hashtag #sandiegofire to the community’s updates.

The idea spread and proved two things. Firstly, that the hashtag had the capacity to build and connect online communities and secondly that it could have an informational use-value in the real world.

By 2009 Messina’s evidence from the fires changed minds at Twitter and they added an option for users to search for hashtags. As they caught on, their Janus-like characteristics began to surface. They were a force for good and ill. A social media mechanism for organising campaigns had arrived, but its undercarriage carried the hidden prospect of “fake news” and malicious misrepresentation.

The online magazine The Conversation sees a dark side to hashtags, claiming that they “can multiply damning accusations and sink reputations without guaranteeing the accused constitutional protections and the due process of law. Indeed,

arguably nowhere is a person more vulnerable to maltreatment, insult, vilification and slander and nowhere is he or she more prone to a trial by public opinion than on the internet.”

The abuse of the hashtag is probably at its most obvious in the fag-end of commercialised social media, when brands try to reach out to customers. Many a lazy digital agency has conned commercial brand managers out of their annual budget on the promise of a slick hashtag and a lame campaign. Susan Boyle’s album launch was just one of hundreds of hashtags that didn’t quite work out there in cynical cyberspace. The hashtag #susanalbumparty was too vulnerable to misinterpretation to work and the Chester Literary Festival were probably best advised not to use #ClitFest, at a time when the clitoris is at peak sensitivity.

In years to come, American history will be told as a battle of hashtags in which the defining ideologies of the era pitted Barack Obama’s hope-over-fear slogan #YesWeCan against Donald Trump’s #MAGA – Make America Great Again.

The big successes have not been in sloganeering or corporate posturing but in calls to action in areas where the internet has an umbilical link to the real world. Hashtag activism has a powerful story to tell. The Black Lives Matter Global Network is a chapter-based, member-led organisation whose mission is to build local power and intervene in violence inflicted on black communities by the state and vigilantes. It has been turbo-charged by social media but its credibility has been earned in the real world at demonstrations, boycotts and direct action protests, especially in those neighbourhoods where young black people have been shot by armed police. The organisation and its hashtag surfaced almost organically when Trayvon Martin, an unarmed black teenager, was shot to death in Florida.

Although now synonymous with the prosecution of producer Harvey Weinstein, the #MeToo movement against sexual harassment and assault pre-dates the scandal by several years. The term was first used on MySpace back in 2006 by the Bronx activist and survivor Tarana Burke. Since, it has exploded as a global movement with chapters across the world including Afghanistan, India and Nigeria.

Raising awareness is one of the great success stories of the hashtag era. There cannot be a charity around today that has not raised money, recruits or consciousness through a hashtag. Many of them owe a debt of gratitude to the ALS Ice Bucket Challenge, the campaign to raise awareness of amyotrophic lateral sclerosis, better known in Scotland as motor neurone disease.

You know the drill, a hapless victim sits on a chair whilst a bucket of ice and freezing water is emptied over them and phone cameras record their humiliation. Driven by social media, the craze became so popular that it attracted the high-profile participation of presidents and pop stars, from Obama to Justin Beiber.

At its height the hashtag #IceBucketChallenge brought over 600,000 new donors to the charity and the ALS association raised an astonishing $35.5 million, dwarfing all previous campaigns.

Whilst critics claimed that the challenge was a form of narcissism that allowed people to indulge themselves whilst not really engaging with the campaign, the vast majority saw a form of everyday social activism.

Messina has now proved what Twitter once doubted – the hashtag is mainstream and will be with us in its many forms for a long time to come. Scotland’s journey to becoming an independent nation in Europe will throw up many more ruses on the way and as long the light stays on only our imagination can let us down.