greenpeace / planet4

Built on top of Wordpress tech, Greenpeace Planet 4 powers digital platforms to engage with millions and win campaigns around the world.
https://planet4.greenpeace.org
Creative Commons Attribution Share Alike 4.0 International
64 stars 26 forks source link

Add a setting to load Tag Manager scripts from a custom domain #187

Closed stduerre closed 2 months ago

stduerre commented 3 months ago

Feature summary:

When using server-side Tag Manager, it's possible to load the scripts for it from a custom domain instead of the default www.googletagmanager.com. The main advantage is to make loading the script more resistant against ad blocking. The feature does not affect how we handle consent for trackers, but it enables us to load tag manager for people who give consent in the cookie banner, but might use an ad blocker for just ads.

Proposal & Constraints:

Proposed implementation can be found here.

There's already a setting for the Tag Manager Container ID (google_tag_manager_identifier), a setting for the custom domain can be added in the same way. It needs to be used in two places: In the Tag Manager JS and in the noscript tag for Tag Manager.

Additional context:

The use of the feature is limited to offices using server-side tag manager as that's a requirement to load the scripts from a custom domain. There are multiple NRO's (and GPI) that do use it currently.

Basically, the feature enables us to follow this setup guide, specifically step 2: https://developers.google.com/tag-platform/tag-manager/server-side/dependency-serving?tag=gtm#step_2_update_the_script_source_domain_

stduerre commented 3 months ago

@jmarubay is also interested in using the feature for GPI

comzeradd commented 2 months ago

Fixed at d6e5e70b5e62fdf00e7dd16516b5422236ceb8b6