By Darren Waters
Technology editor, BBC News website
Trials of an online ad system carried out by BT involving more than 30,000 of its customers were potentially illegal, says a leading digital rights lawyer.
BT has said it trialled a prototype of Phorm, which matches adverts to users' web habits, in 2006 and 2007.
The company did not inform customers that they were part of the trial.
Nicholas Bohm, of the Foundation for Information Policy Research, said tests without the knowledge of users were "an illegal intercept of users' data".
A spokesman for BT said the firm had no comment about the legality or illegality of the 2006 test.
In a statement the firm said the trial was "a small scale technical test of a prototype advertising platform".
"The purpose of the test was to evaluate the functional and technical performance of the platform."
'Robust and fit'
It continued: "It is important for BT to ensure that before any new technologies are deployed, they are robust and fit for purpose. No personally identifiable information was processed, stored or disclosed during this test."
Earlier this month BT told BBC News that before the 2007 test it had taken "legal and other external advice... and on the basis of that advice commenced the small scale technical test in good faith".
Eighteen thousand customers were involved in the 2006 trial and BBC News understands that the 2007 test was on a similar scale.
Virgin Media and Talk Talk are also due to deploy the technology and there is no suggestion that the two companies have trialled the system in the past.
The Foundation for Information Policy Research has written to the Information Commissioner to argue that Phorm contravenes the Regulation of Investigatory Powers Act 2000 (Ripa), which protects users from unlawful interception of information.
Phorm and BT have said the technology does not breach any UK laws.
Following advice from the Home Office, both companies have said the technology complies with UK law as customers have to give informed consent to use the technology.
BT has said that customers will be issued with amended terms and conditions before any eventual roll out of the technology.
A planned third test of the system will take place next month. The company will be approaching 10,000 customers asking them to take part.
Mr Bohm told BBC News: "If the customers in 2006 and 2007 weren't invited to do anything and it was completely surreptitious, and assuming that BT and Phorm trialled a version of what they are planning to launch later this year, then it was a massive scale illegal interception.
"They couldn't at that stage have had any guidance from the Home Office, or had anything in writing, as nothing was issued until January this year."
He added: "This was highly intrusive and highly objectionable to set up a profiling system based on their customers online activities, especially since the customers knew nothing about it."
Fipr has argued that Phorm must not only seek the consent of web users but also of website operators for the technology to be legal.
Phorm's system works by "trawling" websites visited by users and then matches keywords from the content of the page to a profile.
Users are then targeted with adverts that are more tailored to their interests on websites that have signed up to Phorm's technology.
Phorm has said its technology will improve the internet experience for users as they will receive more relevant adverts.
The company also believes its technology will boost the finances of websites because adverts will reach more targetted audiences.