Follow code can you add in the header or anywhere on your website: or this code. This code only load the js file when webp not supported by browser & is PageSpeed optimized: