However, they will have to iron out the final details with EU lawmakers, who have proposed tougher rules and higher fines.
Frustrated by the slow pace of antitrust investigations, EU competition chief Margrethe Vestager has proposed two sets of rules known as the Digital Markets Act and the Digital Services Act targeting Amazon, Apple, Alphabet unit Google and Facebook.
The DMA has a list of dos and don'ts for online gatekeepers - companies that control data and access to their platforms - reinforced by fines of up to 10% of global turnover.
The Digital Services Act (DSA) forces the tech giants to do more to tackle illegal content on their platforms, with fines of up to 6% of global turnover for non-compliance.
The common position adopted by EU countries follows the main points proposed by Vestager, with some tweaks, with the European Commission as the main enforcer of the new rules despite an initial French proposal to give national watchdogs more power.
Negotiations are expected to start next year, with the rules likely to be adopted in 2023.
"The proposed DMA shows our willingness and ambition to regulate big tech and will hopefully set a trend worldwide," Zdravko Pocivalsek, Slovenian Minister for Economic Development and Technology, said in a statement.
The changes agreed by the EU countries include a new obligation on tech companies that enhances the right of end users to unsubscribe from core platform services and shortens the deadlines and improves the criteria for designating gatekeepers.
Luxembourg, where Amazon has its European headquarters, welcomed the agreement which designates national watchdogs as the lead DSA enforcer for companies based in their countries.
"Luxembourg is pleased that in general the country in which the intermediary is established remains responsible for the enforcement of the harmonised rules of the DSA, in particular thanks to closer cooperation with the other Member States and the Commission - apart from when it comes to the very big players," it said in a statement.
(Reporting by Foo Yun Chee; Editing by Angus MacSwan)
By Foo Yun Chee