I need to create a segment for "mobile phone" traffic (not tablets)
I realize this can be done in Adobe Analytics and shared via the cloud but we have not implemented the Adobe Cloud Visitor ID. My current solution is to use an expression target using syntax provided by a co-worker with more coding skills than I possess.
Any easier ideas on how to do this in Classic?
Greg
var userAgent = user.header( 'user-agent' ) || '';
var mobileAgents = [ 'iPhone', 'Windows Phone', 'Android', 'Mobile' ];
for( var i = 0; i < mobileAgents.length; i ++ ) {
if( userAgent.indexOf( mobileAgents[ i ] ) > -1 ) {
return true;
}
}
return false;