Hi There,
Well there are two ways to approach this problem:
- The rightest way to fix the problem is to implement a server side redirect system, rather than a JavaScript redirect (client-side). This is best practice for mobile redirects, and the way that a majority of the sites on the web do it.
The reason why you're getting those first pageviews is because the GA snippet has time to fire before the user is redirected to mobile. With a server-side redirect, no HTML is loaded, so the GA snippet never fires.
2a) The sort-of hacky way to fix this would be to apply filters that exclude mobile visits from your reports. It'd be wise to create a new profile, though, so you still have the mobile device traffic for analysis in your regular profiles.
2b) Another hacky fix: Suppress the GA snippet when a mobile device is detected. You could adapt the logic you have in place that redirects mobile users to the mobile site to the GA snippet. For example:
var deviceMatch = navigator.userAgent.match(/Blackberry/i) || navigator.userAgent.match(/Symbian/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i) ||navigator.userAgent.match(/Android/i);
if (!deviceMatch && $.cookie('full_site')) {
{Fire GA}
}
All that said, the 2nd options are NOT the right way to go about things. Option 1 is definitely what should be done.
Mike
CG8IeaO.png