title: Inject different Ad code based on UTM parameters
body: <p>I have a website that needs to serve Ad units from a specific Ad program when there are specific UTM parameters in the URL, and the user needs to see these Ad units as long as they stay on the website. However, when a user comes without those UTM parameters, I can serve any Ads I want, which I would want to be Google AdSense.</p>
  <p>This was done rather simply using PHP and cookies. However, this does not work when the website is cached and the HTML code cannot change.</p>
  <p>Javascript came to mind, but I have a problem making it work.</p>
  <p>I now have a working cookie which is created from UTM parameters, and then I just need to serve pieces of Ad code (Adsense script, the other Ad program script, and Ad Units) based on the values in the cookie, something like this:</p>
  <pre><code>var cookievalue = Cookies.get('utm_source');    
  if (cookievalue == &quot;something&quot;) {
        serve the NOT Adsense code
      } else {
        serve the Adsense code
      }
  </code></pre>
  <p>any ideas how to do that so that the serving scripts are added properly to the code?</p>