Adds E2E tests for the integration with WP Consent API.
Scenarios covered:
GA4W sets the global wp_consent_type variable to optin if it's not currently set
Consent granted update is sent for analytics_storage when the WP Consent API category statistics is allowed
Consent granted update is sent for ad_storage, ad_user_data, and ad_personalization when the WP Consent API category marketing is allowed
The current consent state is sent when the page loads if the default state is denied and the current state is granted
The current consent state is sent when the page loads if the default state is granted and the current state is denied
_Note: Scenario 2 & 3 cover on page updates via the wp_listen_for_consent_change event listener. Scenario 4 & 5 are immediate updates when the page loads based on the current event state._
Screenshots:
Detailed test instructions:
Checkout add/wp-consent-api-integration-tests and build extension
Changes proposed in this Pull Request:
Follow-up to #425
Adds E2E tests for the integration with WP Consent API.
Scenarios covered:
wp_consent_type
variable tooptin
if it's not currently setgranted
update is sent foranalytics_storage
when the WP Consent API categorystatistics
isallowed
granted
update is sent forad_storage
,ad_user_data
, andad_personalization
when the WP Consent API categorymarketing
isallowed
denied
and the current state isgranted
granted
and the current state isdenied
_Note: Scenario 2 & 3 cover on page updates via the
wp_listen_for_consent_change
event listener. Scenario 4 & 5 are immediate updates when the page loads based on the current event state._Screenshots:
Detailed test instructions:
add/wp-consent-api-integration-tests
and build extension