The funny thing is: in German public transit there is no ticket scanning. You have to stamp single use tickets in rather old stamping machines, so no data collection there other than the count of stamps. Any longer time-ticket isn't scanned or stamped per travel anyway.
Not sure whether they use the camera systems these days for this purpose, but in older times they would do statistical counting, e.g. have people (often students) ride certain trains and collect passenger counts.
That isn't universal. There are places which have no stamping machines anymore. Because any ticket, be it bought at a ticket machine, or the driver, already is "stamped". There may be some leftover installs in older vehicles, on lend from somewhere, or occassional use out of the "Verkehrsverbund", to be lended elsewhere, but they are getting rare. I actually can't remember when I've last seen them.