Anyway, the problem boiled down to any template that came with X-Cart which didn’t have the login form built in on every page, but instead required you to go to a login page to enter your credentials, wouldn’t redirect back to the original page you came from. So the process is pretty simple to fix. And this fix should be on the mark for X-Cart 4.3.x by the way, and should work for other templates that use the login page.
Even when I first started using Google Analytics I always preferred to put the tracking code at the top of the page. It just made more sense to me to make sure that I didn’t loose or miss some visitors in the statistics. I understand why it is normally recommended to add it to the bottom. By putting it at the bottom it allows your entire page to load, and the last thing to load is the Google Analytics so that the visitors can view the page faster. But here’s where the Asynchronous Tracking can help out. This code is designed to load first in the
tags of your page, and it will load at the same time as your page. This prevents any delays, but also ensures you are getting the statistics you really need.