The government has replied to a legal challenge from the European Commission (EC) over the online advertising technology Phorm.
Phorm provides a model that allows advertising to be targeted at users online.
In April, the EC told the UK to ensure there were procedures in place to ensure clear consent from the user for his or her private data to be used in this way.
"Technologies such as internet behavioural advertising can be useful for businesses and consumers, but they must be used in a way that complies with EU rules," EU telecoms commissioner Viviane Reding said at the time.
Two ISPs – BT and TalkTalk – have since dropped plans to use Phorm.
Although the government did not disclose the text of its response to the EC, David Hanson, a junior minister in the Home Office, wrote to Parliament this week.
"The Home Office expressed an informal view about targeted online advertising and RIPA [Regulatory of Investigatory Powers Act] in response to a number of requests. That note concludes that targeted online advertising systems might be lawful if consent was expressed appropriately," he wrote.
The Information Commissioner has said that the technology does not infringe privacy as long as consent is given on the basis of an opt-in system – which means that people must agree to use it.
The EC is now considering the government's reply.
The European Union Directive on Privacy and Electronic Communications requires member states to ensure the confidentiality of communications and related traffic data. States must, it says, prohibit interception and surveillance unless the users concerned have given their consent.