Our "thankyou" page (goal page) is not recording all of our conversions. For instance, our analytics account is showing 19 conversions for yesterday, but we actually had 34 conversions.
The situation and the Code:
Our thankyou page is being called dynamically from the checkout page through a jquery/ajax call when the user clicks "complete order". The script sends the form data via an ajax post. A successful response returns the html for the thankyou page, which contains a summary of the customers order along with the conversion code. The conversion code is run through a jquery function, $.globalEval(), to execute the scripts in the response, like so:
In the ajax response, we have our GA code which is recording a virtual pageview, recording some ecommerce data, and also recording Adwords statistics. Our virtual pageview code included in the response is as follows:
For whatever reason, our conversion is only recording SOME of the time. It is a bit puzzling, and we have done alot of testing and prodding to no avail. I am trying to avoid separating the thankyou page as a completely different pageload, because we have alot of different ajax style features we plan on implementing, but not if we cannot accurately record pageviews and track goals.
We have our main GA tracking code in the header of our checkout page. We are using the newer style, non-blocking, GA tracking code.
Does anyone have experience in trying to implement something similar to this where you are performing an ajax call to the goal page, and performing a virtual pageview? Why does our conversion record only SOME of the time? Is GA filtering our conversions and if so, why? Is it possible that this problem has nothing to do with ajax, but rather with using virtual pageviews for our sales funnel?
Any help would be much appreciated, and if you need any further information please ask. Thanks!