Important Information: The top JS minify settings, Before </head>, After <body>, and Before </body> allow you to tweak HOW your JavaScripts are loaded in different parts of your site.
I had success loading JS before </head> as non-blocking using “defer” and loading JS before </body> as non-blocking using “async.”
I did not embed any JS after <body> but you may try this setting as a third embed option in order to get your minification to work.
The below settings under JS file management allow you to tweak WHAT JavaScripts are being minified and WHERE your JavaScripts are loaded, whether in the <head> tag or at the end of your page, before </body>.
Pro Tip: Several other blogs recommend embedding JS before </body> (this is essentially the footer as I understand it) whenever possible, so try this setting first. If stuff breaks, move it to the head, save, and test again.
How to populate your JS file management list
From GTMetrix
Go to your GTMetrix Speed Report. Under the PageSpeed tab, expand Defer parsing of JavaScript. You’ll need to add and test each script on GTMetrix’s list here, placing it in the <head> or before </body> with different embed settings. You can copy+paste the link starting from wp-includes/js/jqery/jquery.js. You don’t need your HTTP or domain name as a part of the file name. Or…
…From the Help menu at the top of the Minify page
Scroll to the top of the Minify page and click on the help wizard button.
You’ll be presented with a pop-up box with a list of JavaScript files. Many of these files will be the same files listed on GTMetrix and Google PageSpeed Insights.
In my own case, I had around 14 JS files that needed to be “minified” according to GTMetrix, so I picked one and started testing. JS in the Plugins folder is a good place to start as minifying those didn’t cause any problems with my site.
If you have JS from a plugin that’s causing a blocking red flag, check the “Add” checkbox for that one file in the pop-up help wizard window.
From the Template drop-down, select All Templates. From the Embed Location drop-down, first try Embed before </body>. Now click Apply & Close.
Templates allow you to choose on what page/post types you want the JS minification to take place. Most of the time, All Templates is fine. However, for certain JS files, I chose Template: Page as I didn’t want to effect JS image lightbox effects on my project pages or comment posting on my posts.
Child Theme: I use a child theme of Divi and all my W3 minification settings were made with that child theme selected, not Divi itself.
Select one file at a time in order to save and test each change you make. If you notice something break after minifying a new JS file, go back into the JS File Management settings and try changing its embed location to Embed in <head>.
Remember, our <head> embed settings are set to defer and our before </body> settings are set to load async or asynchronously. Some JS will not work if it’s not loaded in the head. Some will not work if embedded as “defer.” The third option that I didn’t personally use, After <body>, may be useful if you need a third Embed Type option.