With the referendum in the balance, campaigners are on the streets and social media, trying to swing the undecided

The polls have narrowed so much that a result once nearly taken for granted now hangs in the balance; the media are under fierce attack for bias; and questions are swirling about foreign influence and online ads.

As Ireland heads into the last week of campaigning for its historic referendum on abortion, the long shadow of two recent surprise election results – the Brexit referendum across the Irish sea, and Donald Trump’s victory in the 2016 US presidential poll – is hanging over Irish voters.

They will decide on Friday whether to repeal an amendment dating back to the 1980s that enshrined in the constitution a near-total ban on abortion. The controls are the strictest in any western democracy, meaning that the battle has been closely watched by anti-abortion activists across the world.

Quick guide The Irish abortion referendum Show Hide The Irish abortion referendum Ireland is set to vote on abortion law reform on Friday 25 May. In a the referendum, voters will decide if they want to repeal an article in the republic’s constitution known as the eighth amendment. The amendment, or article 40.3.3 of the constitution, gives unborn foetuses and pregnant mothers an equal right to life – and is, in effect, a ban on abortion. Currently, terminations are allowed only when the life of the mother is at risk, with a penalty of up to 14 years in prison for breaking the law. The government in Dublin has promised to introduce legislation allowing for abortions during the first 12 weeks of pregnancy if the vote goes in favour of repeal. Photograph: Clodagh Kilcoyne/X03756

The campaign began with a clear lead for the Yes campaigners, who support a repeal. But in a country where tradition and the church still have strong influence, the No camp has gained ground. Now the final result is expected to hinge on the one in five voters still undecided.

“Obviously, we look at Brexit and Trump and think the media don’t always get it right any more. Or they are projecting one way to advance their own goal,” said Emer Tóibín, of the Meath for Life campaign, which opposes a repeal.

She believes the narrowing in polls is due in part to campaigners sidestepping newspapers and television to reach voters more directly. “So much of the country had been fed one side of the story,” she says in a cafe near her home in the county town Navan. “Freedom of speech is not alive and kicking.”

She is stepping up the campaign in the run-up to the poll, determined to reach undecided voters and those “reluctant to discuss their views” – the elusive “silent majority” credited in both British and American upsets.

Tóibín’s sense of urgency may be the one thing she shares with Sheila Donohue, a Catholic grandmother from a conservative background who admits she doesn’t know where she would have stood had the referendum been held a decade ago.

Now, though, she is preparing to go out on the doorsteps appealing to voters for a repeal, inspired by a tragedy that thrust her family reluctantly into the heart of the debate.

“I will now go out canvassing,” Donohue said. “I was so irate about things being said by people from a position of ignorance. They are punishing suffering.”

In 2010, her daughter Siobhán found out at a routine scan for her third pregnancy that her son would not survive outside the womb, because his brain had not developed. Devastated by the prospect of carrying her baby to term only so that she could bury him, she travelled to Liverpool for a termination. After her return, she began fighting for other women in her position to receive treatment at home through the group Terminations for Medical Reasons.

Donohue has always supported her daughter without reservation, but behind the scenes. She even moved churches, choosing a congregation where no one knew her or her husband, to avoid discussing a difficult and highly emotional issue with fellow worshippers. But for the first time this week she will personally appeal to her fellow citizens to support a repeal. The trigger was the narrowing polls and a controversial debate on the national broadcaster, RTE, which was the subject of multiple complaints. “You do have to keep at the back of your mind that it might not get through,” she said. “People are entitled to their opinion, but I will be telling Siobhán’s story.”

The already intense campaign was given an unexpected twist, and greater international attention, earlier this month when the US tech giants Google and Facebook said they would be changing the rules on political advertising in Ireland over concerns about foreign interference.

Facebook Twitter Pinterest A pro-life rally in Dublin last weekend. Photograph: Artur Widak/AFP/Getty Images

Google banned all adverts linked to the referendum, particularly frustrating No campaigners who say they were relying on social media to bypass conventional outlets they accuse of bias. Facebook has barred foreign groups from paying for ads. It has also rolled out a new transparency tool so that anyone in Ireland can track advertisements online, although it requires laborious page-by-page checks in real time.

These changes, along with an effective transparency campaign and greater international scrutiny of the nature and impact of online campaigns, make some in Ireland feel like both guinea pigs and pioneers, stumbling towards better ways to regulate democracy in the internet age.

“It feels like we are in the middle of this live test case,” said James Lawless, technology spokesman for the opposition Fianna Fáil party, who is pushing for legislation to regulate online advertising.

It is one of the first votes held in a major western democracy since the Cambridge Analytica scandal, and since US authorities began public attempts to untangle the extent of foreign interference in the 2016 presidential campaign.

And it is the first time that activists have tried to track political messages reaching voters through their screens in something of a David and Goliath fight. The volunteer campaign group the Transparent Referendum Institute is logging individually captured ads that tech giants keep on private, easily searchable databases. So far, they have found more than 900 online advertisements, many not from groups registered with Irish election authorities.

Eamon Ryan, leader of Ireland’s Green party and an advocate for greater transparency, welcomes attempts to tackle problems but suspects the tech giants are driven more by concerns for their own reputation than for Ireland’s democracy. With inquiries under way on their role in Trump’s win and Brexit, they do not want to face accusations that their platforms helped to skew the outcome in Ireland’s emotive abortion referendum. “I think the decisions of Google and Facebook were largely driven by American political concerns,” he told the Observer. “Their fear was that a certain [result in the] Irish vote would trickle back to American politics.”

He also wants them to provide more details about online campaigns, including how much has been spent, and details of why they took such dramatic steps to limit advertising in Ireland, a decision that must have cost them money. “We would like to know what the volume of spending was, how much of that was coming from overseas, what prompted their decision. Was it a sudden increase in overseas spending? Or was it just the political context in the US?”

It is vital to get this information before voters go to the polls, he says, so Ireland knows it has had a fair vote on a deeply emotional issue. Both sides believe the intensity of the campaign is likely to seal the issue in legal terms for at least a generation.

But for Sheila Donohue, the fight will not be over until she knows no other woman will face her daughter’s painful trip across to Britain. “They keep suffering over and over as they tell their stories. They can’t get over it until this repeal is done.”