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.
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.
"You can measure who saw your ad on Facebook, who came into your store and ultimately who bought something in the store," Mr Barthel told Fairfax Media on the sidelines of the Nation Retail Federation's annual convention in New York City earlier this month.
"You can measure the entire customer journey, which is the holy grail of marketing."
Facebook started trailing this technology about nine months ago, but Mr Barthel said it faced a number of challenges, such as retailers using several different systems to manage customer data which made it more difficult to build "data pipelines" across to Facebook.
Facebook is also getting better at targeting users with products they might be interested in by using artificial intelligence and machine learning.
Companies have until now identified a broad group of people they want to advertise to - women in their 20s who live in Sydney, for example - and Facebook would target users that fit that profile.
Now, artificial intelligence can crunch huge amounts of data about users, collected by both Facebook and its advertisers, and automatically determine which individuals will be most interested in a particular product.
"Suddenly, your products are starting to search for the right people," Mr Barthel said.
Facebook's smaller sibling Instagram is also starting to flex its muscles in the retail space.
The image-based platform has been a powerful promotion tool, but chief operating officer Marne Levine said Instagram was working on new ways for companies to actually do business on the platform.
Instagram has 800 million users, including 9 million in Australia, and over 80 per cent are connected to a business by choice. She said their behaviour was showing how people actually want to shop online.
"E-commerce has been straight to the buy button but that's not realistic of how people actually do it," she told Fairfax Media.
Instead, users might first discover a brand on Instagram and following them for months before eventually buying something.
Brands could keep that potential shopper interested in the intervening period with engaging posts and "story" videos.
One-third of the content saved through Instagram's new "save post" feature are from business accounts, which Ms Levine said showed users were employing it as wish-list of products they might eventually purchase.
"What this illustrates is that the shopper journey really has changed," Ms Levine said.
Instagram was now working on features that would let businesses complete transactions through its app rather than customer needing to leave to brands' own websites.
"Where we're going is towards more meaningful interactions, not just a place where businesses are discovered but a place where business is actually getting done," Ms Levine said.
Facebook radically overhauled users' news feeds earlier this month to priorities "meaningful" posts from friends and family at the expense of posts by media publishers, businesses and brands.
But Mr Barthel said there would be little change for retailers because they mostly communicate with users through paid advertisements, which would operate the same way as before the changes were made.
The reporter attended NRF 2018 as a guest of Microsoft.