Mobile Detection and Redirection

27 views
Skip to first unread message

Henry Versemann

unread,
May 22, 2013, 4:35:12 PM5/22/13
to dot...@googlegroups.com

Does the following logic:

 


#set($clickstream  = $mySession.getAttribute("clickstream"))

#if($clickstream.isMobileDevice())  
    
$response.sendRedirect('http://m.stchas.edu')
#end

 

Found at :

 

http://www.dotcms.com/codeshare/mobile-detection-and-redirection

 

work without any additional  data needed? I’ve already added this line of code:

 

#set($mySession = $request.getSession())

 

Before the first block of code shown above, in order to get the session variable.

 

I’ve tried using it on our full site and it does not appear to be redirecting any of the mobile devices that we’ve used so far, to our mobile site.

 

Thanks for the help.

 

Will Ezell

unread,
May 22, 2013, 4:46:42 PM5/22/13
to dot...@googlegroups.com
The above code will only work if you have save clickstreams turned on in your dotmarketing-config.properties. 
ENABLE_CLICKSTREAM_TRACKING=true

The clickstream will not work otherwise.

Maybe try a javascript solution?







Will

----
Will Ezell
http://dotcms.com
phone: (305) 900-2001 ext. 7010
direct: (978) 294-9429
skype: wezell1



--
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
Visit this group at http://groups.google.com/group/dotcms?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Henry Versemann

unread,
May 22, 2013, 4:50:36 PM5/22/13
to dot...@googlegroups.com

Will,

 

I’m not sure if we have that config. Property turned on. So how can we tell if it’s turned on, from the backend?

 

Thanks for the information.

 

Henry  

Will Ezell

unread,
May 22, 2013, 5:02:28 PM5/22/13
to dot...@googlegroups.com
Henry:

It's tough to see from the backend.   From the browser, right click on a page and select "Page Statistics". Do you see any data?  If not, my guess is that it is turned off, though you'd need to ask your admin to be sure.


-Will


Will

----
Will Ezell
http://dotcms.com
phone: (305) 900-2001 ext. 7010
direct: (978) 294-9429
skype: wezell1



Henry Versemann

unread,
May 22, 2013, 5:05:00 PM5/22/13
to dot...@googlegroups.com

Will,

 

Since I sent my last response to you our webmaster sent me a note confirming that we do not currently have that property turned on, because it bogged down our database. Thanks.

Will Ezell

unread,
May 22, 2013, 5:24:30 PM5/22/13
to dot...@googlegroups.com
Henry:

Try this codeshare code - it should work even without clickstreams on.  it is taken from the jsp code from http://detectmobilebrowsers.com/







Will

----
Will Ezell
http://dotcms.com
phone: (305) 900-2001 ext. 7010
direct: (978) 294-9429
skype: wezell1



Henry Versemann

unread,
May 22, 2013, 5:26:42 PM5/22/13
to dot...@googlegroups.com

Will,

 

Thanks. I may have some questions later.

Kivi Shapiro

unread,
May 23, 2013, 9:37:42 AM5/23/13
to dot...@googlegroups.com
This regular expression concerns me.  it's very clever, but it just gives too much opportunity for both false positives and false negatives.  There are a lot of different mobile devices out there, and trying to enumerate them all, and only them, is just asking for trouble.

If you want to go that route anyway, though, I'd recommend using WURFL's database, which is the same one used by Facebook and Google.  The folks at ISAAC have put together a plugin for it which you can read about at http://dotcms.com/plugins/mobile-visitor-detection.

Kivi

Kivi Shapiro
Qualicom Innovations

Henry Versemann

unread,
May 23, 2013, 9:55:23 AM5/23/13
to dot...@googlegroups.com

Kivi,

 

Thanks for the response. Due to the cost of using the WURFL database, we’re unable to go in that direction. At this point I’m not sure if we’ll use the code using the regular expression, other than maybe as a short term way to make things work temporarily, while we come up with another approach. Thanks again.

 

Henry

Kivi Shapiro

unread,
May 23, 2013, 11:19:10 AM5/23/13
to dot...@googlegroups.com
Free, isn't it?  http://sourceforge.net/projects/wurfl/files/WURFL/

They do have some other offerings that you can pay for, including a cloud-based system that always has the latest updates, but does the downloadable database cost anything?

Kivi Shapiro
Qualicom Innovations

Henry Versemann

unread,
May 23, 2013, 11:20:04 AM5/23/13
to dot...@googlegroups.com

Not sure. It was previously looked at by our webmaster and ruled out because of cost. That’s all I know.

 

From: dot...@googlegroups.com [mailto:dot...@googlegroups.com] On Behalf Of Kivi Shapiro
Sent: Thursday, May 23, 2013 10:19 AM
To: dot...@googlegroups.com
Subject: Re: [dotcms] Mobile Detection and Redirection

 

--

Kivi Shapiro

unread,
May 23, 2013, 11:27:42 AM5/23/13
to dot...@googlegroups.com
Another free resource, this one open source, is OpenDDR, https://github.com/OpenDDRdotORG/OpenDDR-Resources.

Henry Versemann

unread,
May 23, 2013, 11:35:02 AM5/23/13
to dot...@googlegroups.com

Thanks Kivi. I’ll check it out.

 

From: dot...@googlegroups.com [mailto:dot...@googlegroups.com] On Behalf Of Kivi Shapiro
Sent: Thursday, May 23, 2013 10:28 AM
To: dot...@googlegroups.com
Subject: Re: [dotcms] Mobile Detection and Redirection

 

Another free resource, this one open source, is OpenDDR, https://github.com/OpenDDRdotORG/OpenDDR-Resources.

--

Reply all
Reply to author
Forward
0 new messages