[x] 🧪 As guest or not admin. Check woocommerce-google-analytics-integration-gtag-js-after script is loaded with all the gtag config: gtag("config", "G-XXXX", {"track_404":true,"allow_google_signals":true,"logged_in":false,"linker":{"domains":[],"allow_incoming":false},"custom_map":{"dimension1":"logged_in"}});
[x] 🧪 As guest or not admin. check woocommerce-google-analytics-integration-js script is loaded the main file
[x] 🧪 As guest or not admin. check woocommerce-google-analytics-integration-data-js-after script is loaded with all the window.ga4w config: i.e for the cart page: window.ga4w = { data: {"cart":{"items":[{"id":9154,"name":"Incredible Bronze Watch"
[x] 🧪 As guest or not admin. Go to shop and verify page_view is sent
[x] 🧪 Log as admin. None of those scripts should be attached.
3. Check consent
[x]Â Check that the default consent is enabled
// Set up default consent state.
for ( const mode of [{"analytics_storage":"denied","ad_storage":"denied","ad_user_data":"denied","ad_personalization":"denied","region":["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IS","IE","IT","LV","LI","LT","LU","MT","NL","NO","PL","PT","RO","SK","SI","ES","SE","GB","CH"]}] \|\| [] ) {
gtag( "consent", "default", { "wait_for_update": 500, ...mode } );
}
gtag("js", new Date());
gtag("set", "developer_id.dOGY3NW", true);
gtag("config", "G-XXXXX", {"track_404":true,"allow_google_signals":true,"logged_in":false,"linker":{"domains":[],"allow_incoming":false},"custom_map":{"dimension1":"logged_in"}});
[x]Â Add a snippet for changing those settings, and verify is being sent in the debugger:
Setup
Checklist
0. Installation 🧪
1. Settings
Settings
( WooCommerce → Settings → Integration → Google Analytics )G-28QSQJCS9D
2. Check scrips and data is loaded 🧪
google-tag-manager-js
script is loading async https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXwoocommerce-google-analytics-integration-gtag-js-after
script is loaded with all the gtag config:gtag("config", "G-XXXX", {"track_404":true,"allow_google_signals":true,"logged_in":false,"linker":{"domains":[],"allow_incoming":false},"custom_map":{"dimension1":"logged_in"}});
woocommerce-google-analytics-integration-js
script is loaded the main filewoocommerce-google-analytics-integration-data-js-after
script is loaded with all thewindow.ga4w
config: i.e for the cart page:window.ga4w = { data: {"cart":{"items":[{"id":9154,"name":"Incredible Bronze Watch"
page_view
is sent3. Check consent
4. Check default theme shop page events
view_item_list
is being triggered for the products in the grid.add_to_cart
is being triggered.select_content
is being triggered.5. Check blocks (Products Beta) events
Prereqs. Create a page with "Poducts Beta" block on it.
view_item_list
is being triggered for the products in the grid.add_to_cart
is being triggered.select_content
is being triggered.6. Check blocks (All Products) events
Prereqs. Create a page with "All Products" block on it.
view_item_list
is being triggered for the products in the grid.add_to_cart
is being triggered.select_content
is being triggered.7. Check triggers (Classic pages) events
Prereqs. Create a page with [products] shortcode on it.
view_item_list
is being triggered for the products in the grid.add_to_cart
is being triggered.select_content
is being triggered.8. Check Single product page events
view_item
is triggered.view_item_list
is triggered for the related items.add_to_cart
is being triggered.select_content
is being triggered.add_to_cart
is being triggered.add_to_cart
is being triggered.9. Check Cart
remove_from_cart
event was triggered.remove_from_cart
event was triggered.10. Check Purchase
begin_checkout
was triggered.purchase
was triggered.11. Disabling events
view_item_list
event is not being triggered anymore.add_to_cart
event is not being triggered anymore.select_content
event is not being triggered anymore.view_item
event is not being triggered anymore.remove_from_cart
event is not being triggered anymore.begin_checkout
is not triggered.purchase
is not triggered.12. WP Consent API integration
wp plugin install wp-consent-api --activate
wp plugin install autoptimize --activate
view_item_list
is being triggered with all "Denied" consent.wp_set_consent('statistics', 'allow')
. Verify thatanalytics_storage
consent was updated.add_to_cart
is being triggered with updated consent.view_item_list
is being triggered with "Granted" consent.wp_set_consent('marketing', 'allow')
. Verify thatad_storage, ad_user_data, ad_personalization
consent was updated.add_to_cart
is being triggered with updated consent.view_item_list
is being triggered with all "Granted" consent.wp_set_consent('statistics', 'deny')
. Verify thatanalytics_storage
consent was updated.add_to_cart
is being triggered with updated consent.view_item_list
is being triggered with "Denied"analytics_storage
consent.