This article describes how to provide Web content to mobile devices through WML
(Wireless Markup Language). More specifically, this article covers how to track users;
that is, how to recognize a repeat visitor to your site.
WML and WMLScript version 1.1 are supported by the majority of mobile devices in use
today. The articles assume a working knowledge of HTML and general Web technologies, and
further assume that you have read the previous article(s) in this series.
The Value of Recognizing Users
There are a variety of reasons to implement a recognition system that acknowledges
that a user that has previously visited your site. The most useful of these reasons is to
remember user preferences.
For example, suppose that you offer a service of finding particular restaurants near a
user. Each user may prefer a certain type of food, environment, etc., and knowing where
the user is located is important so that you can find restaurants in that vicinity. Of
course, users don't want to input all their preferences every time they visit your
site—it's better to save most of the settings, recognize users when they return,
and recall their settings.
How To Recognize Users
When WML was first implemented, the code could retrieve the user's cell phone number
from the device; this phone number could act as a unique identifier. Unfortunately, this
ability was recognized as an invasion of privacy, and the feature was discontinued. Now
there is no way to retrieve a unique identifier from the user's device.
What options are left? You could have the user input his or her telephone number on
each visit, assign the visitor a login name, or have the user enter an identifier during
each visit. Better yet, why not store the identifier on the user's device for recall each
time he or she visits your site?
Cookies: The Good, the Bad, and the Ugly
The term cookie refers to the HTTP technology that allows a site to store
data on a user's machine. When cookies were first used, they were fairly innocuous,
intended primarily for storing user preferences. However, it didn't take long for the
business side of the Web to realize the potential of cookies and begin using them for
their own purposes—tracking user activities, shopping habits, and other bits of
personal information.
Shortly thereafter, the media and user advocates led the charge against cookies,
causing most modern browsers to offer the option of refusing to store any cookies, or
allowing the user to choose when a cookie should or should not be stored. Unfortunately,
refusing cookies causes problems for Web sites that use cookies to store user preferences
and login info, requiring the user to reenter such info on each visit.
Note: I don't condone the illicit use of cookies for tracking users'
personal information, but do recognize the utility of storing frequently used information
to aid the user experience.