It's called Wi-fi Indoor Positioning. Last I heard, the state of the art uses triangulation of signal strengths between multiple access points. This gives it 'aisle-level accuracy', or about 5-10m.
It's pseudo-anonymous in that they can get a unique identifier for your device (and thus know how often the device returns to the store) but can't tie it to your real identity without more information.
And given the mediocre accuracy of the technology it would be hard to correlate it with, for example, their point of sale system (e.g. 'device XYZ was near checkout 3 at the same time that John Smith's loyalty card was used there, therefore device XYZ is owned by John Smith').
I've been asked for an address when making a $5 cash purchase. I have the baseless impression that it is marketing seminar advice that small specialty businesses get (That is, collecting addresses).
If you are shop owner, you could pretty accurately know where are your customers living.