Tracking stuff came as soon as you could communicate asynchronously with a server, really. It became widely known and a plague in the 10s but it started as soon as Ajax was available. Keep in mind that Google and most of the websites were free and ads driven almost from the start because that was the only way to create a critical mass of users.
the paid version is still Free and Open source. In this case free stands for Free as in Free speech and not as in Free beer.
Also none of the Free or Open source licences prevent you to sell the compiled software. Hell, most of the Open source licences don’t even prevent you to close the source code (Mozilla, MIT, etc.) it’s only the GPL and a few others that mandate that the source code must be made available on request…