Facebook is closing in on the "holy grail" of marketing - knowing how the advertising it shows to its more than 2 billion users affects them when they stop scrolling and go shopping in the real world.

The social media giant's head of global retail and ecommerce strategy, Martin Barthel, said it had recently started closing the gap in what it knows about users' online and off-line behaviour.

Facebook is getting better at knowing what to advertise to you. Credit:Wayne Taylor

Under a recent partnership with some US retailers, Facebook can track when a smartphone-carrying user has gone into an advertisers' physical store by using geolocation tracking, “beacon” technology or data from public Wi-Fi networks.

The “cherry on the top”, Mr Barthel said, is when those retailers send Facebook in-store transaction data, gathered from loyalty schemes or by credit card companies.