We all know supermarkets use information about our shopping habits to target us with personalised vouchers and offers – but how would you feel about sitting down to watch a movie and being confronted with adverts based on what was in your shopping trolley a few hours earlier?

Or what would you think about Tesco using its Clubcard database to check what you are eating, and possibly offering vouchers for salad and fruit if your basket is usually groaning with unhealthy items?

These are just two of the ways the supermarket giants are planning to make use of the data they gather on us.

For every loyalty point or coupon that Sainsbury's, Tesco and the like dish out, they gobble up a huge amount of information about our shopping habits. We are all familiar with targeted offers linked to loyalty cards, but you might be surprised at the amount of data the big retailers collect on all of their shoppers – and even potential customers – and what they do with it.

If you have opted out of taking out a loyalty card because you don't want "Big Brother in your shopping basket", then too bad, because the supermarkets also track debit and credit card payment data and till receipts – so someone, somewhere, knows about that bottle of wine you bought at 12.28pm on Tuesday, and that you recently switched your brand of athlete's foot cream.

How do the supermarkets use this data?

If you have a loyalty card or shop online, the supermarkets will build up a demographic profile of you, and collect data about how loyal you are, what you buy and how much you spend, says Guy Montague-Jones of The Grocer.

They can then change what you see when you log in to make it easier to find the products their data suggests you will buy, and in-store they will use their data to make decisions about what they sell.

For example, Sainsbury's discovered that a cereal brand called Grape-Nuts was worth stocking – despite weak sales – because the shoppers who bought it were extremely loyal to Sainsbury's and often big spenders.

Last month the supermarket giant announced it was taking full control of Sainsbury's Bank by buying the 50% it didn't already own – partly because its data showed that after taking out a bank product, Sainsbury's shoppers became more loyal and spent more in-store.

Tesco, meanwhile, is using data about what its 16 million Clubcard holders buy in its stores to serve targeted ads to online users of its new free movie service, Clubcard TV. Launched in March, this streaming site also offers TV shows such as The Only Way is Essex, and is available to anyone with a computer and a broadband connection.

But in order to tune in, you have to register your Clubcard number and postcode. Clubcard TV director Scott Deutrom boasted on his blog that "we can target adverts based on what our customers bought yesterday" (a Tesco spokesperson later claimed this was just "a vision" at the moment).

What if you haven't given the supermarkets your personal details?

Even if you haven't handed over your details and product preferences through a loyalty scheme, it's likely you have used a debit or credit card to pay for your shopping at some point – and this is another way that the supermarkets can track what we buy.

"We know that an anonymised card number paid for a particular basket of groceries one week and how much was spent with the same card number the following week," says a Morrisons spokesperson. "It means we know when customers are lapsing because we won't see their card for a week. We use it to measure the effectiveness of promotions and events."

Supermarkets can use your card details to learn more about you. Photograph: David Levene for the Guardian

When asked whether its customers give permission for their card numbers to be tracked in this way, the supermarket says customers "would only need to opt in" if Morrisons intended to send them any form of communication.

"All the large grocers track payment cards in this way," says Matthew Harrop at data analysis firm emnos. "All your till receipts are linked together using either a known customer identifier – or anonymously in the absence of a loyalty card – to analyse what you're buying and how loyal you are."

Waitrose and Asda also admit analysing aggregated payment card data to monitor "customer shopping patterns" (for example, items purchased) over time. Both stress this is common practice in the retail industry and that card numbers are not connected to an individual or an address. Sainsbury's and Tesco say they do not track or monitor their customers' payment cards.

The supermarkets also want to find out what their customers are doing outside their stores. Waitrose, for example, paid data analytics firm Beyond Analysis to use "aggregated and anonymised data" about shoppers' Visa card transactions to help it decide on new store locations.

Beyond Analysis integrated the Visa transaction data with Waitrose's own data to figure out what proportion of potential customers were buying groceries from other supermarkets, and the general locations of these competitors.

A Waitrose spokesperson says the supermarket would never see details about an individual customer's spending – the data would only show broad trends. Along with Visa, the supermarket emphasises that the work fully complied with the Data Protection Act. Beyond Analysis refused to comment and Waitrose says it no longer works with the firm.

However, both MasterCard and Beyond Analysis still offer data analytics services to UK retailers - which means anonymised, aggregated information about what we are all spending on our credit and debit cards and where we are spending it is potentially up for grabs to the highest bidder.

How is it that your card data can be monitored in this way?

Visa says it requires its issuing banks to seek your agreement when you apply for the card. MasterCard states, in its global privacy policy, that it will "perform data analyses" and offers the chance to opt out on its website. Otherwise, you are automatically opted in.

Both Visa and MasterCard emphasise that they do not hold your personal details, such as your name and address.

What if I pay in cash?

Sainsbury's and Morrisons can still monitor what you buy and identify products which, when they are scanned in at the till, act as '"triggers" for the cashiers to hand over different types of incentives.

Coupons at tills are used to target cash-paying customers. Photograph: Alamy

Both use a "coupon-at-till" system called Catalina, which proclaims on its website that it "finds just the consumers whose buying preferences match" a particular product. At Sainsbury's, Catalina also makes extensive use of the wider Nectar card database.The database contains information about what Nectar cardholders buy at every retailer in the scheme - not just at Sainsbury's - which makes it particularly adept at identifying and targeting customers according to their demographic profile. Sainsbury's is using its data to offer online discounts to in-store shoppers from large households with kids, to give them an incentive to shop online.Its rival Morrisons doesn't have a loyalty card database to rely on. Instead, it admits it will buy in "very detailed and segmented demographic data" and use this to analyse your shopping basket and extrapolate trends about what you are purchasing, so it can decide which offers to target you with. Morrisons claims all of its competitors do the same.

What do the supermarkets do with all the different data they collect?

"A brand of, say, coffee will approach Sainsbury's, Morrisons or Tesco and ask to buy access to customers purchasing rival brands, so it can put an offer to these customers," says Charles D'Oyly, MD of Valassis, which handles the redemption of product coupons for supermarkets. Brands are willing to pay "a lot of money" to the supermarkets for this service, he says, because the amount of customers redeeming these "highly targeted" coupons jumps from as little as 1% to "over 50%".

Tesco, Morrisons and Sainsbury'ssay they would not allow a brand to solely target the loyal customers of one particular rival. Sainsbury's and Tesco also stressed that they do not sell their loyalty data to third parties but would not divulge details about how they work with brands to provide customers with "relevant" offers and promotions.

How to make this work for you

Can you use your knowledge of these supermarket strategies to get more offers and vouchers?

One way, says Charles D'Oyly of leading coupon and voucher services provider Valassis, would be to open a couple of extra loyalty cards and alternate between them – to confuse the store's data crunchers into thinking you frequently shop elsewhere. "If the supermarkets can see you are spending money on nice food but no wine, they'll guess you're buying it from another retailer and push wine offers in your direction," he says. "The same if you buy, say, dog treats but no other dog food."

Look at your spending from the supermarket's perspective. "A very loyal customer might not be offered any discount coupon, because the supermarket thinks it has already captured all your grocery spend," says Matthew Harrop, a director at retail data analytics consultancy emnos. "But a shopper who the retailer believes is buying groceries elsewhere, or isn't shopping online with the store, may get a rich offer such as £10 off a £50 spend."

In other words, "disloyal" customers tend to be offered the best incentives. So, if you want more love from your favourite supermarket, start shopping at its competitors. Donna Ferguson