Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confirm compatibility with Blocks #2020

Closed
3 tasks done
mikkamp opened this issue Jul 21, 2023 · 4 comments · Fixed by #2028
Closed
3 tasks done

Confirm compatibility with Blocks #2020

mikkamp opened this issue Jul 21, 2023 · 4 comments · Fixed by #2028
Assignees

Comments

@mikkamp
Copy link
Contributor

mikkamp commented Jul 21, 2023

Describe the issue:

As mentioned in woocommerce/woocommerce-blocks#9212 there could potentially be some compatibility issues with blockified content. In particular with the tracking code.

Tasks:

  • The add_to_cart hook is only used for analytics tracking and already has an alternative for blocks: https://github.com/woocommerce/google-listings-and-ads/blob/2.5.0/js/src/gtag-events/index.js#L18-L25
    Double check it though to make sure there wasn't any changes since we use the hook prefix experimental__woocommerce_blocks, in case that's no longer experimental.

  • The Order Confirmation page, at the time of creating this wasn't fully "blockified" yet and was using a separate WP page which would call the hook. Recheck this to make sure it's still called with a fully blockified cart/checkout process.

  • We should also double check the following warning:

⚠️ Order confirmation page - works ok for now, in most cases (sometimes it doesn't fire, but I don't think that's blocks specific) however be careful when the order confirmation page is blockified, we should ensure the action still fires.

Uncover any details on which scenarios it doesn't fire.

@puntope
Copy link
Contributor

puntope commented Jul 25, 2023

Double check it though to make sure there wasn't any changes since we use the hook prefix experimental__woocommerce_blocks, in case that's no longer experimental.

I checked this in the last version of WooCommerce and seems to be still experimental__woocommerce_blocks-cart-add-item

https://github.com/woocommerce/woocommerce-blocks/blob/trunk/assets/js/base/context/hooks/use-store-events.ts#L23

@puntope
Copy link
Contributor

puntope commented Jul 25, 2023

⚠️ When creating a new page "Test Page" -> add Block -> Products (Beta)

Then Add to cart event doesn't trigger

@puntope
Copy link
Contributor

puntope commented Jul 25, 2023

Order confirmation page - works ok for now, in most cases (sometimes it doesn't fire, but I don't think that's blocks specific) however be careful when the order confirmation page is blockified, we should ensure the action still fires.

✅ This works for me with the classic Checkout page and also creating a new page and adding a Checkout block.

The order confirmation shows the purchase event.

I'm unsure if I need to do anything else to consider the Order confirmation page as "blockified"

@puntope
Copy link
Contributor

puntope commented Jul 27, 2023

⚠️ When creating a new page "Test Page" -> add Block -> Products (Beta)

Then Add to cart event doesn't trigger

I see here we trigger the event when the "Add To Cart button click" happens...

However, then we blocked the trigger for Blocks based Add to Cart button https://github.com/woocommerce/google-listings-and-ads/pull/1636/files#diff-05cafd66cd2e43b74298e2724b55d282f9054e7747d6e7f190f5f6769f8c4e51R72

It seems that the now experimental__woocommerce_blocks-cart-add-item is not being triggered by Products (Beta) Blocks.
Yes it's being triggered in All Products Block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants