I want to redirect users to an external website once they checkout successfully. Adding additional scripts on the Post-purchase page didn’t work
here is my script but it didn’t work. Even a console log doesn’t work.
Topic summary
A user is attempting to redirect customers to an external website after successful checkout but encountering issues with their implementation.
Problem Details:
- Scripts added to the Post-purchase page are not executing
- Even basic
console.logstatements fail to run - The provided code snippet appears corrupted or reversed (characters are backwards)
Technical Context:
- The script attempts to:
- Detect the thank-you page URL
- Extract the Shopify checkout order ID
- Construct a redirect URL with the order ID as a parameter
- Perform the redirect using
window.location.href
- Uses a
DOMContentLoadedevent listener
Current Status:
The issue remains unresolved. The code formatting suggests either a copy-paste error or encoding problem that needs correction before troubleshooting the actual redirect logic.