I would increase an exterior JS file into the header or footer of the website where the module is installed (and only when It is installed). Also, in order to customize your PrestaShop store to fulfill distinct business specifications, then addons can be very useful for your store. For example, https://addons.prestashop.com/en/seo-natural-search-engine-optimization/41205-custom-html-css-js-on-selected-pages.html