Adding code in Child theme Functions.php shows Google Map error on Static page
I have added some code on my child theme's functions.php to 'Remove query strings from static resources'. This is very important especially for the site speed and cache purpose. However, when I add any kind of extra code in functions.php and then go to any ad URL I get a message, 'The google maps api server rejected your request......'. When I click 'OK' I can then view the ad but it happens everytime when I visit a new ad page.
Here is an example
I have removed google map from my site and I don't need to use anything related to it. I would very much like to have the code in functions.php. Help is much appreciated!