Before the web, user information was gathered based on TV channels you watched by vans equipped with radio equipment that could detect which channels were active on a TV as they drove through neighborhoods for ratings or licensing purposes: https://www.theguardian.com/no...
Credit card companies, magazine subscriptions, and mail order catalogs requested were also valuable sources of consumer interests
The search engines and social media are simply extending the concept which is how they get paid for all the free software and services you get.
You can skew the AI engines and results somewhat by periodically visiting completely random sites or posting completely random things way out of your normal interests and watch where those interests show up in ads on other web sites. Industrial equipment is my favorite alternate go to.
Do all the exercises.
The question of whether computers can think is just like the question of whether submarines can swim. -- Edsger W. Dijkstra