Google has agreed to pay $17m to settle allegations from 37 US states and the the District of Columbia that the search giant had inserted cookies to snoop on Apple’s Safari web browser consumers by bypassing privacy settings.

Reports revealed that the Safari browser used on iPhones and iPads automatically bars third-party cookies, while Google reportedly modified the code of its cookies to circumvent the blocks during June 2011 to February 2012.

Google said in a statement that the company has worked hard to get privacy right and have taken steps to remove the ad cookies, which collected no personal information, from Apple’s browsers.

"We’re pleased to have worked with the state attorneys general to reach this agreement," a spokesperson for Google said.

Google will no longer use the adapted code without user permission, except for security, fraud or technical issues, while also offering users with more information about cookies for the following five years.

In August 2012, Google agreed to pay $22m to settle an investigation by the US Federal Trade Commission (FTC) associated with the same issue.