-
Notifications
You must be signed in to change notification settings - Fork 69
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
Remove URL params from woopay_source_url #7924
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +170 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @malithsen!
Just a few comments about plain permalinks, also this URL we send on the iframe shouldn't be updated too?
@@ -73,7 +73,9 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => { | |||
? {} | |||
: { | |||
save_user_in_woopay: isSaveDetailsChecked, | |||
woopay_source_url: window.location.href, | |||
woopay_source_url: window.location.href.split( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would not work with plain permalinks, maybe we can change it to wcSettings.storePages.checkout.permalink
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch! Updated in abbd2a4
I wasn't sure if storePages
would be available on all sites. Then realized that it's set in Blocks. Since Blocks is packaged with WooPayments we should be good.
@@ -291,7 +293,7 @@ const CheckoutPageSaveUser = ( { isBlocksCheckout } ) => { | |||
<input | |||
type="hidden" | |||
name="woopay_source_url" | |||
value={ window.location.href } | |||
value={ window.location.href.split( '?' )[ 0 ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in abbd2a4
Thanks for the review @alefesouza
Yeah, good catch. Updated in b85428d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Changes proposed in this Pull Request
woopay_source_url
that is used to track WooPay marketing consents, currently store the complete URL. This can break checkout when a store appends URL params and the URL is very long.This PR removes the URL parameters in the URL to reduce its length.
Testing instructions
To replicate URLs with params
http://wcpay.test/checkout/?param1=value¶m2=value2
To replicate checkout error with long URLs.
Test the fix
platform_checkout_source_url
metafield.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge