woocommerce / woocommerce-google-analytics-integration

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

Add dedicated integration with Product Bundles #439

Closed tomalec closed 4 months ago

tomalec commented 4 months ago

Changes proposed in this Pull Request:

Add dedicated integration with Product Bundles, Use ->get_bundle_price( 'min' ); instead of ->get_price() for bundles.

Fixes https://github.com/woocommerce/woocommerce-google-analytics-integration/issues/219 the simple way.

Checks:

Screenshots:

image

Detailed test instructions:

  1. Install and activate the Product Bundles (PB) extension
  2. Add a new bundle product image
  3. Add bundled products that are priced individually image
  4. Publish the product bundle
  5. Open the site through https://tagassistant.google.com/
  6. Go to the product bundle page
  7. Check that view_item event is tracked with the correct bundle price
  8. Add the bundle to cart
  9. Check that add_to_cart event is tracked with the correct bundle price
  10. Uninstall the PB extension and smoke test for regression.

Additional details:

  1. I didn't add E2E tests, as PB is a paid extension, and public contributors to this repo would not be able to use it to run E2Es locally. We can try mocking PB interface, but then it's not really E2E. I'm open to better ideas :)

Changelog entry

Add - WooCommerce Product Bundles integration.

tomalec commented 4 months ago

Thanks, @martynmjones, for catching that! I applied your suggestions. Speaking of tests, as there are none for get_formatted_product so far, WDYT of adding them as a follow-up in the next porter or cooldown cycle?

tomalec commented 4 months ago

Thanks :) Created the follow-up issue to track tests https://github.com/woocommerce/woocommerce-google-analytics-integration/issues/442