Privacy advocates fear that users will be identifiable, though others have pointed out that identification of most users will be almost impossible without the unlikely cooperation of internet service providers (ISPs).
Viacom has said that it has no interest in identifying users and their habits but privacy advocates have expressed concern about the transfer of information.
In the same court ruling Google won an argument over the release of its source code for YouTube, successfully arguing that it was a protected trade secret. The court said that Viacom needed more than just "speculation" if it was to win the release of the code.
Viacom, which owns MTV, VH1 and Nickelodeon, demanded the YouTube usage information in order to prove its contention that copyright infringing material on the video sharing website is more frequently viewed than non-infringing material.
It has been granted the right to access YouTube owner Google's records containing details of which video was watched when and the internet protocol (IP) address of the computer used to view the video. For viewers with YouTube accounts, the login name will also be handed over.
Google argued that it should not be forced to hand over the details because of users' privacy concerns, but the court said that there was no precedent cited for protecting that privacy.
"Defendants cite no authority barring them from disclosing such information in civil discovery proceedings, and their privacy concerns are speculative," said Stanton in his ruling. "Defendants do not refute that the 'login ID is an anonymous pseudonym that users create for themselves when they sign up with YouTube' which without more 'cannot identify specific individuals'."
Though it said it would not appeal the ruling, Google did say that it thought it excessive. "We are disappointed the court granted Viacom's overreaching demand for viewing history," said Google senior litigation counsel Catherine Lacavera in a statement. "We will ask Viacom to respect users' privacy and allow us to anonymize the logs before producing them under the court's order."
Viacom said that it was not interested in using the information to identify individuals. "Any information that we or our outside advisors obtain will be used exclusively for the purpose of proving our case against YouTube and Google," it said in a statement. "It will be handled subject to a court protective order and in a highly confidential manner."
Google did manage, though, to keep secret the source code that lies behind YouTube's search system. The court order said that this is the same search system that lies behind Google's own main search engine.
Noting that there is "no dispute that the [the code's] secrecy is of enormous commercial value," judge Louis Stanton of the US district court said that it was too valuable to be released without some evidence backing Viacom's assertions.
Viacom claims that Google has deliberately designed its search technology to locate copyright infringing material, and sought access to it to back up that claim. Stanton said, though, that Viacom "provide no evidence that the search function can discriminate between infringing and non-infringing videos".
"YouTube and Google should not be made to place this vital asset in hazard merely to allay speculation," he said. "A plausible showing that YouTube and Google's denials are false, and that the search function can and has been used to discriminate in favor of infringing content, should be required before disclosure of so valuable and vulnerable an asset is compelled."
Struan Robertson, a technology lawyer with Pinsent Masons, the law firm behind OUT-LAW, said that the data requested was excessive.
"The volume of data to be disclosed seems entirely disproportionate to Viacom's purpose. If they only need to gauge the popularity of the content, statistical data should suffice. There should be no need for IP addresses or login names," said Robertson.
"I can't see why they need all that data. If nothing else, it will take an enormous effort to process what must be about three years' worth of data. Surely Viacom could establish its point far more easily with one month's data, rather than all of it?"
Robertson also said that some activists' fears about identification from the logs may be unfounded.
"It would be impossible for Viacom to match all the IP addresses to identifiable users. While some IP addresses will reveal where users work, home users will only be traceable as far as their ISPs. Without the cooperation of the ISPs, Viacom won't know who the users are – and that cooperation would not be forthcoming even if Viacom was inclined to request it," he said.
"There's no reason for YouTube users to be concerned. If they just watch videos on the site, they're doing nothing wrong. However, the ruling breaks a basic principle of data security, which says that data should only be transferred where necessary to fulfil a purpose. This data disclosure exceeds its purpose and that's why it's flawed. Instead, login names should be removed because some of them will identify individuals and IP addresses should be replaced with untraceable numbers," said Robertson.