Google has been accused of tracking the web activities of Apple iPhone owners that used their handset to browse the net.

According to the Wall Street Journal, the search engine was among a number of advertising companies, including Vibrant Media, Media Innovation Group and PointRoll, that used a programming code that allowed them to monitor users online behaviour when surfing the web using Safari, despite the fact the browser blocks user tracking through cookies by default, unlike other browsers.

The WSJ said code was spotted by Stanford researcher Jonathan Mayer and subsequently confirmed by an independent technical adviser, Ashkan Soltani. In tests, Soltani discovered the Google tracking code was installed on a PC via ads on 22 of the top 100 websites, while ads on 23 sites installed the same code on an iPhone browser.

"The Journal mischaracterises what happened and why. We used known Safari functionality to provide features that signed-in Google users had enabled. It's important to stress that these advertising cookies do not collect personal information," Google said in a statement.

Safari stops cooking being installed unless a user interacts directly with a website. However, Google's code made the browser believe a web users had submitted a form to the website, allowing the cookies to be installed. However, while the code tracks the sites a users visit, it does not collect any personal information

Google has since disabled the code.

"Unlike other major browsers, Apple's Safari browser blocks third-party cookies by default. However, Safari enables many web features for its users that rely on third parties and third-party cookies, such as 'Like' buttons," said Rachel Whetstone, senior vice president of communications and public policy, in a statement.

"Last year, we began using this functionality to enable features for signed-in Google users on Safari who had opted to see personalised ads and other content - such as the ability to '+1' things that interest them," said Whetstone.

Google said it created a "temporary communication link" between Safari and Google's servers, to identify Safari users that had opted for this type of personalisation.

"We designed this so that the information passing between the user's Safari browser and Google's servers was anonymous – effectively creating a barrier between their personal information and the web content they browse," said Whetstone

"We didn't anticipate that this would happen, and we have now started removing these advertising cookies from Safari browsers. It's important to stress that, just as on other browsers, these advertising cookies do not collect personal information."

Meanwhile, Apple added it had "put a stop to the circumvention of Safari privacy settings".