title: Does this Funnelytics code contain a race condition?
body: <p>I'm looking into tracking scripts that I've come across. Here's one by Funnelytics. At first look it seems like it has a bug:</p>
  
  <pre><code>(function(funnel) {
      var insert = document.getElementsByTagName('script')[0],
          script = document.createElement('script');
      script.addEventListener('load', function() {
          window.funnelytics.init(funnel, false);
      });
      script.src = 'https://cdn.funnelytics.io/track.js';
      script.type = 'text/javascript';
      script.async = true;
      insert.parentNode.insertBefore(script, insert);
  })('8889dbc2-6c2f-5ba4-c201-dc8889dbc26c');
  </code></pre>
  
  <p>Isn't it possible that the function triggered by <code>load</code> will be called before the asynchronous script <code>track.js</code> gets executed? In which case, won't the line <code>window.funnelytics.init</code> fail, since <code>window.funnelytics</code> hasn't been defined yet?</p>