Hi,
You can put this code in the masthead. For this you need to customize the standard masthead file, deploy the file to server, create iview of custom masthead file, add this iview to framework page, assign framework page to portal desktop, assign this portal desktop to end user.
Regards,
Navya.