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

Fix the JS exceptions and incorrect quantity value for checkout event tracking #343

Merged
merged 2 commits into from
Dec 28, 2023

Conversation

eason9487
Copy link
Member

Changes proposed in this Pull Request:

Closes #341
Closes #342

  • Fix the incompatible data structure that causes JS exceptions when sending checkout event tracking for issue #341.
  • Fix the incorrect quantity value when sending checkout event tracking for issue #342.

Checks:

  • Does your code follow the WordPress coding standards?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully run tests with your changes locally?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Screenshots:

1

Detailed test instructions:

  1. Install and enable Google Analytics Debugger.
  2. Use Woo with version >= 8.1.0.
  3. Edit the checkout page to use the Checkout block.
    image
  4. Open the Console tab in the browser's DevTool.
  5. Add items to your cart and go to the Checkout page.
  6. Check if there is no longer JS exception in the Console tab.
  7. Check if the quantity (~qt\d+~) value in the begin_checkout or checkout_progress event tracking is correct via the Console tab.

Changelog entry

Fix - Avoid JavaScript exceptions when sending checkout event tracking due to incompatible data structure.
Fix - Correct misplaced each product index value as its quantity when sending checkout event tracking.

@eason9487 eason9487 requested a review from a team December 27, 2023 07:16
@eason9487 eason9487 self-assigned this Dec 27, 2023
@github-actions github-actions bot added changelog: fix Took care of something that wasn't working. type: bug The issue/PR is a confirmed bug. labels Dec 27, 2023
Copy link
Contributor

@jorgemd24 jorgemd24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eason9487 for fixing this. I can't see the JS exceptions and the event is now sending the correct qty 👍 . Noticed something odd though— the Google Analytics Debugger displays "Sending event 'xxx' to undefined." Any idea why it's showing as undefined?

image

@eason9487
Copy link
Member Author

Thanks for quickly helping with the review, @jorgemd24

Noticed something odd though— the Google Analytics Debugger displays "Sending event 'xxx' to undefined." Any idea why it's showing as undefined?

This discussion might be the reason: https://support.google.com/tagmanager/thread/212303562/sending-event-page-view-to-undefined-in-ga-debugger

@eason9487 eason9487 merged commit c05be3b into trunk Dec 28, 2023
3 checks passed
@eason9487 eason9487 deleted the fix/341-342-checkout-event-tracking branch December 28, 2023 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fix Took care of something that wasn't working. type: bug The issue/PR is a confirmed bug.
Projects
None yet
2 participants