Every site would have to run their own data analysis and sell their own ads. Advertisers would be unlikely to take Google or anyone else's word, so audits would be necessary but difficult to conduct. It wouldn't completely end online advertising but would turn it back into something closer to the old traditional model where those selling ad space had a handful of semi-generic personality models for their readers/users and advertisers would select one that best matches the profile of their target customer. It destroys the economics of centralized data collection.
There are many other laws that could accomplish a similar end but through different means. The biggest barrier would be getting politicians to not care about the demands of huge tech companies that dump endless amounts of money into lobbying and campaign funding.