Facebook and other companies routinely track your online surfing habits to better target ads at you. Two web browsers now want to help you fight back in what's becoming an escalating privacy arms race.

New protections in Apple's Safari and Mozilla's Firefox browsers aim to prevent companies from turning "cookie" data files used to store sign-in details and preferences into broader trackers that take note of what you read, watch and research on other sites.

Lance Cottrell, creator of the privacy service Anonymizer, said Apple's effort was particularly significant, as it takes aim at a technique developed by tracking companies to override users' attempts to delete their cookies.

Safari makes these protections automatic in updates coming Tuesday to iPhones and iPads and a week later to Mac computers. Firefox has similar protections on Apple mobile devices and is rolling out them out to personal computers in the coming months.

To get the protections, you'll have to break your habit of using Google's Chrome browser, which by some estimates has more than half of the worldwide browser usage. Safari and Firefox have less than 20 per cent combined.

Even then, Safari and Firefox can't entirely stop tracking. For starters, they won't block tracking when you're using Facebook or Google itself. Nor can they help much when you use phone or tablet apps, unless the app happens to embed Safari, as Twitter's iPhone app does.

But Will Strafach, a mobile security expert who is designing data security tools for phones, said imperfect protection is better than no protection. He notes that burglars can still break down a door, but that doesn't mean you shouldn't bother locking it.

Cookies and other trackers can be used by companies to keep track of who you are as you move from website to website. The companies can build a digital profile as you, say, read about Democratic or Republican viewpoints, buy a particular brand of pet food or indulge in the entire season of Keeping Up With The Kardashians.

News, video and other third-party sites use Google and Facebook cookies to customise ads to your hobbies and interests, rather than hawking products you might never buy. That's why you might see an ad for shoes soon after searching for them elsewhere.

Apple says its tests show that some popular websites are embedded with more than 70 such trackers. Many of these are from Facebook and Google, which are expected to command a combined 57 per cent of the US$107 billion US digital advertising market this year, according to the research group eMarketer.

Though general awareness of data collection has grown in the wake of Facebook's Cambridge Analytica privacy scandal, how trackers work behind the scenes remains a mystery to many people.

Ghostery and other products have long offered tracking protection. The browsers are now trying to incorporate that directly so you don't have to go looking for browser add-ons.

Safari will try to automatically distinguish cookies that are useful from ones that are there just to track you. Apple notes that cookies can appear in unexpected places, such as sites that embed 'like' and 'share' buttons. Now, those cookies will be blocked until you click on one of those buttons, in which case you'll be prompted for permission to allow the tracking. If you don't, your 'like' won't register.

FINGERPRINTING

Safari is also attacking a technique developed to circumvent cookie deletions. Through 'fingerprinting', a company can identify you through your computer's characteristics, such as browser type and fonts installed. Your new cookie can then be tied to your old profile. Safari will now limit the technical details it sends.

Firefox has an anti-tracking feature that also tries to distinguish tracking cookies from useful ones. It's on by default only on Apple's mobile devices. Mozilla is testing a broader rollout for personal computers, though its plans for Android are not yet known. For now, you need to turn it on or use a private-browsing mode, which gets more aggressive at killing cookies, including useful ones.

For PCs, Firefox also has an optional add-on, called Facebook Container, to segregate your Facebook activity from everything else. Think of it as a wall that prevents Facebook from accessing its data cookie as you surf elsewhere. A version is available for other trackers, too, but requires configuration on your part.

None of the Firefox tools, though, address fingerprinting.

- AP