Should this be legal is a question you could argue both ways, but in my opinion society will be worse off with per customer pricing.
I'm not OK with this. Simple reason, it leaves the wide masses with no other option than to sell their data to survive.
Your mistake is assuming it's a discount, when it's not. For example, Safeway near me charges exorbitant prices for goods which are anywhere from 30-50% lower in the app. What they're doing is the same as your average dark pattern, you're only getting the real price using the app otherwise they charge a no-app fee. And even then you can't tell what the real price is supposed to be, because the app will tailor discounts to your shopping behavior.
Shoppers can and have noticed the price discrepancy [1] which is why this legislation is happening in the first place. If the price isn't the price then the whole basis of capitalism and consumer choice falls apart because there's no way to make a proper determination if Store A is cheaper than Store B.
[1] https://www.consumerreports.org/money/questionable-business-...