I wouldn't worry about alexa but.. you haven't really told us what you're after.
If you just want the java script on your site, you can add this in your ad_ location, in the footer option.
yup, I'd add it in the footer ad template
you can also add it directly to the footer template, but then you may run into problems when/if there is another xf update.