title: google analytics tracking on iframe
body: <p>How to track urls in iframes with Google Analytics?</p>
  <p>What I do is that I put this code inside the iframe, like I do on the &quot;top&quot; window.. But the iframe isn't tracked in analytics?</p>
  <p>This should work, but it doesn't.. :(</p>
  <h1>iframe</h1>
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;script type=&quot;text/javascript&quot;&gt;
              var _gaq = _gaq || [];
              _gaq.push(['_setAccount', 'UA-35706930-1']);
              _gaq.push(['_trackPageview']);
              
              (function() {
                  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
              })();
          &lt;/script&gt;
      &lt;/head&gt;
      
      &lt;body&gt;&lt;/body&gt;
  &lt;/html&gt;
  </code></pre>