it will add when you do this via the wp-admin, if the thankyou page is your custom page, you can add it via any FTP tool. otherwise do this.
1. copy the js code to a include file
2. copy the inculde file to you thank you page.
you can see steps here
http://www.webreference.com/programming/javascript/external/