Periodically when buying something from an airport shop (in various European terminals), I'll be asked to produce my boarding card to be scanned by staff.
It's not 100% of the time for every purchase, but there doesn't seem to be any logic to it (e.g. type of item bought, total purchase value, etc.). It also seems never to happen within restaurants or bars, just shops.
Is it random selection? & is this a security process or a marketing initiative? Can you opt-out?
EDIT: Just to clarify that in any instance I've experience personally, it has been flights internal to the EU and not related to restricted products like cigarettes or alcohol