I use GA's trackEvent to record user's click event on search autocomplete of my site. When user click on item of autocomplete, I record two event, and then page redirect to the result page. But the problem is: the amount of the two action "click" and "view" is not equal, the amount of "click" > the amount of "view". I see the two request are sent in firebug, but they are both canceled because the page redirect. Even though they are canceled, I can see the result in GA.I just can't understand why they are not equal? The later one failed sometimes?
Here is the code part:
//trackEvent just use _gaq.push("trackEvent", xxx)
trackEvent("search", "click");
trackEvent("search", "view");
window.location.href = des;
We have found that most of the time, when someone clicks a link that redirects from one website to another, that visit will show in Google Analytics as being just another (direct / none) visitor in Google Analytics 🙁 While the redirects sometimes have the referring domain attributed to it, most of the time they don't.
Login to Google Analytics, and go to Acquisition > All Traffic > Channels then click on 'Source/Medium' as your primary dimension, then apply an in-line filter for '301'. Choosing 'Landing Page' as your secondary dimension will provide you with a list of all the 301 redirects that are sending traffic to your site.
Here's the answer to your question:
Google Analytics - Setting the Hit Callback
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With