title: google trend embed redirect me to a page with only the iframe
body: <p>So originally I included the recommended embed link from google trend as this in my html.</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/884_RC03/embed_loader.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; trends.embed.renderExploreWidget("TIMESERIES", {"comparisonItem":[{"keyword":"angular","geo":"","time":"today 5-y"},{"keyword":"react","geo":"","time":"today 5-y"}],"category":0,"property":""}, {"exploreQuery":"q=angular,react"}); &lt;/script&gt;
  </code></pre>
  
  <p>This works out nicely by adding the google trend visualization on top of what I already have in my page. <a href="https://jsfiddle.net/81w0tdap/3/" rel="nofollow noreferrer">JSFIDDLE</a></p>
  
  <p>However at one point I decided that I don't want the embed to be render-blocking. So I added some code to only start downloading and embedding the google trend visualization after <strong>window.onload</strong>.</p>
  
  <pre><code>&lt;script&gt;
      if (window.addEventListener)
          window.addEventListener("load", downloadJSAtOnload, false);
      else if (window.attachEvent)
          window.attachEvent("onload", downloadJSAtOnload);
      else window.onload = downloadJSAtOnload;
  
      function downloadJSAtOnload() {
          //gtrend delayed
          let trendEle = document.getElementById('googleTrend')
          let embedLoaderScript = document.createElement('SCRIPT')
          embedLoaderScript.src = 'https://ssl.gstatic.com/trends_nrtr/884_RC03/embed_loader.js'
          embedLoaderScript.setAttribute('type','text/javascript')
  
          embedLoaderScript.addEventListener('load',()=&gt;{
              console.log('i just finished downaloding embed loader')
              let initiateTrendScript = document.createElement('SCRIPT')
              initiateTrendScript.setAttribute('type','text/javascript')
              initiateTrendScript.textContent = `trends.embed.renderExploreWidget("TIMESERIES", {"comparisonItem":[{"keyword":"angular","geo":"","time":"today 5-y"},{"keyword":"react","geo":"","time":"today 5-y"}],"category":0,"property":""}, {"exploreQuery":"q=angular,react"});`
  
              trendEle.appendChild(initiateTrendScript)
          })
  
          trendEle.appendChild(embedLoaderScript)
  
      }
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>However, adding the script tag later will result in the page being redirected to another page with only the google trend visualization. All my old content will not be in the page anymore. <a href="https://jsfiddle.net/81w0tdap/5/" rel="nofollow noreferrer">JSFIDDLE</a>.</p>
  
  <p>Why is this happening? How come adding the script tag later will result in a 'sorta' redirection? Does it have something to do with how google trend developers write the code in embed-loader? Is there another way to go about this without having the two script tags in my critical rendering path</p>
  
  <p>Thanks.</p>