Ireland has turned into a test case of whether Facebook and Google can thwart foreign groups from influencing elections, and misinformation from spreading. For months leading to Friday’s vote on whether to lift a constitutional ban on abortion, online ads on the issue became increasingly common from international groups attempting to sway the outcome. Of the 280 groups that since February had bought ads on Facebook tied to the abortion vote, 14 percent were based outside the country or in an untraceable location, according to Mr. Dwyer’s group.

How Facebook and Google have responded to these ads is being closely scrutinized because it foreshadows what the companies may try in the United States and elsewhere to keep elections unsullied. Both companies want to show they have improved since the 2016 American presidential election, when Russian agents manipulated Google’s YouTube and Facebook to spread divisive messages to voters. On Thursday, Facebook and Twitter rolled out new election transparency efforts.

Critics warn that if Facebook and Google cannot minimize their negative influence in a country the size of Ireland, which has a population of 4.8 million, far bigger challenges will loom with the midterm elections in the United States this November.

Even so, the effectiveness of the companies’ actions in Ireland has not been clear cut — and it may take months, if not years, to know whether any disinformation campaigns broke through their efforts. That’s especially so since ads are only one part of a larger misinformation problem that also includes organic posts.