You could use the page visibility API to wait until the page is visible before loading the analytics code.
https://developers.google.com/chrome/whitepapers/pagevisibil...
This is only for prerendering. I think joshuahedlund is right about prefetching.