There was shock and celebration across Ireland's political spectrum as the polls closed on the country's latest general election.

For the first time since Ireland gained independence in 1922, Sinn Féin received the most first preference votes in an election.

It means the left-wing nationalist party is now likely to form part of the next Irish government for the first time ever.

The party's surge in votes at the polls reflects data from the online campaign, which shows that Sinn Féin dominated the social media conversation in the lead up to the election.

According to CrowdTangle data, which analyses the total number of interactions that social media pages have, Sinn Féin had more than 60% of the share of the voice, compared to other parties on Facebook.

The party's Facebook page had approximately 350,000 more interactions (likes, comments and shares) than the second-highest party, People Before Profit, in the 30-day period before the election.

In contrast, the two parties that have dominated Irish politics in the last century - Fine Gael and Fianna Fáil - each had less than 10% share of the voice on Facebook.

Total number of interactions on Facebook posts from 08/01/20 to 08/02/20. CrowdTangle Intelligence

On Instagram, Sinn Féin also dominated the conversation, with a 46% share of the total interactions of all parties, which was more than double the second-highest Green Party of Ireland.

This was despite Sinn Féin posting less than any other major party on Instagram in the same 30-day period.

Total number of interactions on Instagram posts from 08/01/20 to 08/02/20. CrowdTangle Intelligence

At the polls, Sinn Féin similarly ran only 42 candidates across Ireland, roughly half the total of both Fine Gael and Fianna Fáil.

Meanwhile, Sinn Féin candidates Mary Lou McDonald and Pearse Doherty had more interactions on their individual Facebook pages than any other Irish politician - and more than four times that of current Taoiseach Leo Varadkar.

While this social media dominance could be attributed to a greater number of followers on Sinn Fein's pages, the party's superior online voice appears to have contributed to their success at the polls.

The highest number of paid adverts on Facebook platforms

According to Facebook's Ad Library, Sinn Féin had the highest number of adverts listed from January 10 until February 8.

Sinn Féin had 843 adverts listed on Facebook-owned platforms, compared to Fine Gael (169) and Fianna Fáil (121).

Elsewhere, the Irish Labour Party had 138 ads listed, while the Green Party were higher with 505, although still short of the total listed by Sinn Féin.

What is also noticeable is that Sinn Féin spent far less money on their Facebook adverts than their primary political opponents.

Whereas Fine Gael spent more than €98,000 on Facebook ads in the 30-day period before the election, and Fianna Fáil in excess of €79,000, Sinn Féin's spending totalled less than €30,000.

In the week leading up to the polls, this trend remained the same, with Sinn Féin spending far less than Fine Gael and Fianna Fáil on Facebook adverts despite listing disclaimers for far more ads.

Analysis of Facebook's Ad Library shows that many of these adverts were targeted at Irish social media users aged between 35 and 54 years old.

Increased support from 'younger, urban voters'

Political analysts have suggested that their success was driven by their rise in support from "younger, urban voters".

Exit polls in Ireland had indicated that Sinn Féin led in all demographics of the electorate under the age of 65.

Sinn Féin has steadily increased their votes in every general election since 2007 and has broadened their profile from a single-issue party to a left-wing alternative to traditional Irish politics.

A notable portion of their online campaign focused on key social issues including housing costs and pension reforms, which may have also swayed older generations to vote in their favour.

While no one party will win enough seats for an outright majority in Ireland, Sinn Féin's co-ordinated social media campaign seems to have aided their unprecedented success at the polls.

And in contrast to the success of far-right politics on social media in recent European elections, the political upheaval in Ireland demonstrates that leftist parties can also dominate the social media race for votes.