Don't the industry-imposed rules for handling credit cards work that way (restricting use of data you already have) though?

Like, I thought a big part of why some stores do loyalty cards is because they enable tracking things that they'd get their credit card privileges revoked if they tracked that way.

Retaining credit card numbers is problematic in and of itself. Then you're just operating a skimmer.