I'm new to Magento and read quite a bit about it, but still not sure how to do this in Magento (I've done it successfully in Drupal for example).
It seems that page.xml (or local.xml) would be the right place to put the scripts for the head, but I don't know in those xml files allow "conditionals" (only show this script in this kind of pages...).
Another option seems to be putting the code in head.phtml of the template. This should work, because it accepts php ifs, but I don't know what code and variables should be used for each case (for showing in product pages, or checkout, or homepage, etc.)
What is the best/cleanest option for this? Could you please give me a code example of how would it be implemented or point to me to the relevant documentation page?
Thanks a lot!