google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.23k stars 286 forks source link

Extend Consent Mode conditions for determining Ads connection status to include a check for an Ads tag as a destination of a Google Tag #9147

Open techanvil opened 1 month ago

techanvil commented 1 month ago

Feature Description

For the Consent Mode feature, we have so far implemented the check for Ads being connected to look for the presence of the Ads Conversion ID or an Ads link.

We should extend these conditions to include the additional check discussed under "when does this apply?" in the one-pager - checking for the presence of Ads tag as a destination of the connected Google Tag.

Note that we are now able to use the Tag Manager API to look up a container by tag ID, so this is now technically feasible. See the tagId parameter for the containers/lookup endpoint and the feature request where it was introduced.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation Brief

Consent Mode backend updates

Datastore changes

Setup CTA Updates

Recommended Badge

Test Coverage

QA Brief

Changelog entry

eugene-manuilov commented 1 week ago

AC ✔️

benbowler commented 3 days ago

Hey @techanvil, I had a deep dive into the Tag Manager docs and API and it appears I can do what is required here using existing APIs. Did I miss a way that GTM can be configured where a tags/containers can be nested in a way that requires us to look up containers to check for Ads linking? If so can you share an example of how to set up tag manager to reach this case and I will update the IB.