Skip to content

Instantly share code, notes, and snippets.

@yahelc
Forked from douglasback/sv_performance.php
Created November 1, 2011 19:09
Show Gist options
  • Save yahelc/1331573 to your computer and use it in GitHub Desktop.
Save yahelc/1331573 to your computer and use it in GitHub Desktop.
Passes Query Count and Template Load Time in a GA Non-Interaction Event. Sent at window.onload to minimize latency.
{if member_group == '1'}
<script>
jQuery(window).load(function(){
_gaq.push(["_trackEvent", "EE Perf", location.pathname, "{total_queries} queries", parseInt({elapsed_time},10), true]);
});
</script>
{/if}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment