Google has a "secret deal" with Mastercard that allows it to track users' shopping habits offline and link that data with adverts they see online.

Over the past year, the multi-million dollar deal has given the tech titan unprecedented insight into whether the ads it runs online translate into real-world purchases.

Users are able to opt out of being tracked. However the deal, uncovered by this week by Bloomberg, was not disclosed to the public by either Google or Mastercard.

The revelation has raised questions about how much data Google is quietly harvesting without user knowledge.

As part of the deal, when a Google user clicks on an online advert, their activity is recorded on a database, even if they don't buy that item. However, if that person uses their Mastercard to purchase the item at a physical store within one month of clicking on the ad, Google sends a report to the advertiser.

A Mastercard spokesman revealed that Google is given information that includes sales volumes and average purchase size. They denied that data could be used to identify exact purchases and said only US users are affected.

The deal with Mastercard allowed Google to launch a tool last year called "store sales measurement" designed to help companies understand how their online advertising spend has an impact on their brick and mortar sales.

A the time of launch, Google didn't reveal how it built the tool or how it worked.

However, it did say that it was able to access 70pc of US credit cards through deals with providers. It’s unclear which other companies Google has struck deals with.

A spokesman for Google called its deal with Mastercard part of a “beta product”, meaning it isn't a finished service.

View photos

The deal with Mastercard has caused concern with privacy advocates.

A spokesman for Big Brother Watch said: "This secret scheme takes Google one step closer towards total surveillance of consumers. As we move towards an increasingly cashless and connected society, opportunities to monitor the purchases, internet activity and daily business of private individuals are being exploited in new and disturbing ways. It is completely wrong that customers are being kept in the dark and given little choice about how their sensitive financial information is being collected and used. Mastercard and Google have serious questions to answer here."

The deal comes as Facebook is also looking to secure its own source of payment data.

The Wall Street Journal reported earlier this month that Facebook has asked large US banks to share card data with the social network.

Facebook’s talks with banks were part of a project to show people’s account data inside the Facebook app and website, the report said.

A Google spokesman said: “Before we launched this beta product last year, we built a new, double-blind encryption technology that prevents both Google and our partners from viewing our respective users’ personally identifiable information.

"We do not have access to any personal information from our partners’ credit and debit cards, nor do we share any personal information with our partners. Google users can opt-out with their Web and App Activity controls, at any time.”