In the EU they have the GDPR laws. I'm a developer, and I wrote the system my company uses to ensure we comply with the GDPR regulations.
I also wrote my companies equivalent of google analytics, and other systems related to the topic at hand. I have to tell you, you are off base on a few things. Reputable companies do not share or sell customer information. They use it internally for their own sales and marketing purposes. I know this from first hand knowledge of being forced to sit through meetings as the "technical guy" who can answer questions.
Keeping track of all your purchases has benefits for you as well.
- If its an in store purchase and you need to return it for some reason you have proof of purchase even if you no longer have the receit.
- If you purchased an electronics devise some companies will send you an email to let you know that a software or firmware updates are available for it.
- Some companies will send you an email when an item has been recalled by the manufacture.
- etc
Scanning your licence for certain drug purchases isn't something they are doing to get your data. The federal and local governments have laws and regulations in place to track the purchase of certain drugs, because they can be used to make illegal drugs. For example products that contain pseudoephedrine can be used to make meth.