That can still be done with anonymized data. It is not necessary to associate purchasing habits with national ID numbers to perform the analyses you listed.
One example of this is when our national newspaper (NRK) did an investigation[1] on "anonymized" GPS data, and could easily find the identities of the persons they belonged to.
[1]: https://www.nrk.no/norge/xl/avslort-av-mobilen-1.14911685