I think @media-queries are simpler. You load the two ad units and under 768px you hide one and show the other. This is valid. The solution you are using is good but as you insert the new ad unit under 768, you also need to remove the other. This guide from Google explains what you can't do: Hiding ad units at anytime (e.g., display:none), unless ...
Check _config.yml file Change it from "www.sitename.com" to "http://www.sitename.com" Source--- here
Only top voted, non community-wiki answers of a minimum length are eligible