Created
August 15, 2011 21:03
-
-
Save araddon/1147856 to your computer and use it in GitHub Desktop.
Async Load After Page Load
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript" charset="utf-8"> | |
| $(window).ready(function(){ | |
| var s = document.createElement('script'); s.type="text/javascript"; s.async = true; | |
| s.src = 'http://s.webtrends.com/js/webtrends.min.js'; | |
| var s2=document.getElementsByTagName("script")[0];s2.parentNode.insertBefore(s,s2); | |
| }); | |
| window.webtrendsAsyncInit = function() { | |
| var dcs=new Webtrends.dcs().init({dcsid:"your_dcs_id",timezone:-8}); | |
| // you can control when call to server happens by running this after pageload, or entire script injection | |
| dcs.track(); | |
| }; | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment