News for hackers. Stuff that matters.
Re:Google Tag Manager, the new anti-adblock weapon (2020) by onion2k on Monday February 21, 2022 @12:35AM (#30412306)
All that random crap will still run in your browser though.

The important thing here is that Google are asking users to proxy scripts from a Google server via a subdomain of their site. That's relatively trivial to do as far as the code and config goes, and not costly for the user or for Google. The advantage to the site and Google is that those scripts now look like first party files; Google are using a first part subdomain to subvert the Same Origin Policy via a proxy.

Every other tracking and ad service will set up the same thing. The reason it hasn't happened in the past is because it was hard to configure. Google are giving every other service the gift of explaining how to do it to users. Going to a website that had 50 tracking bugs from 50 domains will now have 50 tracking bugs from 50 Same Origin Policy allowed subdomains, all unique to that site, and all different so blockers will have a much harder time working out what to block.

The code that runs in the browser doesn't change. The only difference is where it appears to originate from.

Re:Google Tag Manager, the new anti-adblock weapon (2020) by GrifMD on Monday February 21, 2022 @04:12AM (#30413528)
That’s inaccurate. You do still need to run a client side GTM script that adds event listeners for specific actions (like “clicks purchase button”). This is then sent to a server side container with whatever first party identifier the site may have (3rd party IDs aren’t supported as there’s no 3rd party cookies from Facebook and the like). From there a server to server network request is made to whatever tracking platforms (GA, Google Campaign Manager, etc).

Most of the tracking script these days is well written, at least the Google and Facebook libraries, so they generally don’t affect page performance, but some of the smaller players have script that can slow down performance.

With server side GTM, only it’s client side component needs to run, everything else will be server side.