Redirecting to external website after checkout

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.log statements 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 DOMContentLoaded event 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.

Summarized with AI on November 7. AI used: claude-sonnet-4-5-20250929.

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.