title: 400 Bad Request with Google AdSense
body: <p>I am running a website that uses AJAX requests and history.pushState for navigation. </p>
  
  <p>The requested content code contains Google's asynchronus AdSense code:</p>
  
  <pre><code>&lt;ins class="adsbygoogle"
       style="display:inline-block;width:468px;height:60px"
       data-ad-client="ca-pub-xxxxx"
       data-ad-slot="xxxxxx"&gt;&lt;/ins&gt;
  &lt;script&gt;
  (adsbygoogle = window.adsbygoogle || []).push({});
  &lt;/script&gt;
  </code></pre>
  
  <p>The head tag contains the adsbygoogle.js:</p>
  
  <pre><code>&lt;script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>This setup is working for one dynamically loaded pageview. After that, ads don't show up anymore. The error console shows:</p>
  
  <pre><code>400 (Bad Request) in expansion_embed.js:188
  </code></pre>
  
  <p>The expansion_embed.js requests the ad from <a href="http://googleads.g.doubleclick.net/pagead/ads" rel="noreferrer">http://googleads.g.doubleclick.net/pagead/ads</a>. The requestet url contains lots of parameters.</p>
  
  <p>Now, every time the ad <strong>does</strong> show up, the <code>prev_fmts</code> parameter has a value of <code>468x60</code>. If the ad fails to load, this parameter's value is <code>486x60%2C468x60</code>.</p>
  
  <p>What is causing this parameter to change? Is it possible that this change is causing the 400 Bad Request errors?</p>