My solution with the google tag manager code was to modify the google script slightly so that W3TC didn't recognize a path to a .js file.
I changed this: j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;
to this: j.src='//www.googletagmanager.com/gtm.'+'js?id='+i+dl;
And then W3TC doesn't try and append it's querystring right after the id= and mess up the GTM ID necessary to call the script for our account.