woocommerce / woocommerce-google-analytics-integration

WordPress plugin: Provides the integration between WooCommerce and Google Analytics.
http://wordpress.org/plugins/woocommerce-google-analytics-integration/
170 stars 69 forks source link

WC 9.2.0 Compatibility #455

Closed martynmjones closed 1 month ago

martynmjones commented 1 month ago

0. Installation 🧪

1. Settings

2. Check scrips and data is loaded 🧪

3. Check consent


// 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"}});

4. Check the default theme shop page events

5. Check blocks (Products Beta) events

Prereqs. Create a page with "Poducts Beta" block on it.

6. Check blocks (All Products) events

Prereqs. Create a page with "All Products" block on it.

7. Check triggers (Classic pages) events

Prereqs. Create a page with [products] shortcode on it.

8. Check Single product page events

9. Check Cart

10. Check Purchase

11. Disabling events

12. WP Consent API integration

⚠️ Note: Consent defaults are only set for the EEA regions. If running these tests from a country where defaults are not set then a VPN can be used or alternatively set defaults for your country using the following filter.

add_filter(
    'woocommerce_ga_gtag_consent_modes',
    function ( $consent_modes ) {
        $consent_modes[] =
            array(
                'ad_storage'         => 'denied',
                'ad_user_data'       => 'denied',
                'ad_personalization' => 'denied',
                'analytics_storage'  => 'denied',
                'region'             => array( 'GB' ), // <-- Set your country code here
            );
    return $consent_modes;
    }
);