Skip Headers
Oracle® Fusion Middleware User Management Guide for Oracle WebLogic Portal
10g Release 3 (10.3.4)

Part Number E14254-02
Go to Documentation Home
Go to Table of Contents
Go to Feedback page
Contact Us

Go to previous page
Go to next page
View PDF

7 Setting Up Anonymous User Tracking

An anonymous user is someone who visits your portal without logging in. Working with anonymous users can be limiting because you have less information about them. However, you can use tracking tools to find out more about these users, such as the date and time they visit and information in the request or session.

Anonymous user tracking can help you present personalized content to an anonymous user over multiple sessions. For example, you can set up visitor entitlement, delegated administration, and some types of personalization based on that information. Anonymous user tracking gives anonymous users records in a database, where you can store meaningful information about them, such as personal preferences.

Developers use Oracle Enterprise Pack for Eclipse to programmatically set up anonymous user tracking. You cannot use the Administration Console to set up anonymous user tracking.


Campaigns and behavior tracking are not supported for anonymous, non-trackable users. For more information on targeting a Campaign to tracked anonymous users, see the Oracle Fusion Middleware Interaction Management Guide for Oracle WebLogic Portal.

This chapter includes the following sections:

7.1 Using Anonymous User Tracking

WebLogic Portal lets you identify and retain information about non-authenticated visitors to your portals. When you enable anonymous user tracking, non-authenticated users receive a cookie after a predetermined time (the default is 30 seconds), and preference information is persisted in a database rather than in memory.

Each time an anonymous tracked user returns to your portal, the ID in the cookie matches the primary key in the tracked anonymous user database, the previous user properties are maintained, and your personalization and campaign rules work for this user. When an anonymous tracked user registers in your portal, the user profile is moved from the anonymous tracked user database to the user database.

If users do not have cookies enabled or if they delete cookies frequently, there is no way to match the users with their existing records in the anonymous tracked user database, and on subsequent returns to the portal these users are treated as new anonymous users.

Anonymous user tracking can be customized to exclude users who spend less than a designated period of time on your site, avoiding the expense of storing data on irrelevant users.

This section includes the following topic:

7.1.1 Choosing a User Tracking Profile Type

WebLogic Portal supports the following types of user tracking profiles:

  • Anonymous Users – If anonymous user tracking is not enabled, users who visit the site without registering are considered anonymous, non-tracked users. There is no ID associated with the user.

  • Trackable Anonymous Users (also called Trackable Users) – If you enable anonymous user tracking, anonymous users are considered trackable on the first visit. If a trackable anonymous user remains at a site longer than the specified duration, the user is automatically converted into a tracked anonymous user. An ID is associated with the user, but the ID is not persisted.

  • Tracked Anonymous Users (also called Tracked Users) – If a trackable anonymous user remains at a site longer than the specified duration, the user is automatically converted into a tracked anonymous user (the AnonymousProfileWrapper is converted to a TrackedAnonymousProfileWrapper), and a cookie with a randomly-generated ID is placed in the user's browser. That ID is used as the primary key for the user's profile, so when the session ends, the user's properties are persisted and are available for the next visit. If a tracked anonymous user returns, the tracking ID in the user's cookie is used to retrieve the user's tracked data from the database. That data can be used to enable personalization and run campaigns against the user. (If a trackable anonymous user does not remain at a site longer than the specified duration, neither the cookie nor the tracked anonymous profile are created.)


    If the user deletes the cookie, the cookie's tracked anonymous user data remains in the database.
  • Registered Users – If a tracked anonymous user registers at your site, WebLogic Portal retrieves the cookie, then locates the tracked anonymous user profile from the database, and merges that profile with the registered user's profile. The cookie and the tracked anonymous user profile are then both deleted from the database.

  • Unknown Users – Unknown users include users whose status cannot be determined. When the unknown user's session begins, the ProfileWrapper is not yet created.

7.2 Setting Up Anonymous User Tracking

You must configure anonymous user tracking by editing the web.xml file in your web application directory in Oracle Enterprise Pack for Eclipse. You will enable cookies on the user's browser in order to track anonymous users. You must also enable anonymous user tracking for your portal, because the tracking is not enabled by default.

You can target a Campaign to tracked anonymous users. For instructions, see "Targeting a Campaign to Tracked Anonymous Users" in the Oracle Fusion Middleware Interaction Management Guide for Oracle WebLogic Portal.

When you configure anonymous user tracking, you perform the following tasks:

To edit the web.xml file to enable anonymous user tracking:

  1. Locate the web.xml file in the /WEB-INF directory of your portal web project.

  2. Double-click the web.xml file so you can edit it in Oracle Enterprise Pack for Eclipse.

  3. To override the settings from the shared library, add the following lines from Example 7-1 to the web.xml file. Adding this PortalServletFilter component turns on anonymous user tracking in your Campaign.

    Example 7-1 Add this Section to the Web.xml File

              <description>Option to track anonymous users, defaults to false
                   if not set. 'createAnonymousProfile' is ignored if this is
              <description>Length in seconds visitor must be on site before we
              start tracking them. Defaults to 60 seconds if not set
  1. Change the trackedAnonymousVisitDuration parameter value to the number of seconds before tracking begins. During testing, set the trackedAnonymousVisitDuration in Example 7-1 to a small number (for example, 5) so that your sessions quickly switch to tracked sessions.

  2. To create a user profile that can store information about each anonymous user, change the createAnonymousProfile parameter value to true, as shown in the following code sample.

       <description> Filter will create an anonymous profile for every
          session. Defaults to true if not set</description>

    The default is true. To disable the creation of anonymous user profiles, set the value to false. If the enableTrackedAnonymous parameter is set to true, the createAnonymousProfile parameter is ignored.


    The createAnonymousProfile parameter does not enable anonymous user tracking from one session to the next without registering; this would require the enableTrackedAnonymous value to be changed to true. If a user visits your site and then registers within the same session, any data collected on that user is persisted in the account of that registered user.
  3. Save your changes to the web.xml file.

  4. You can see more detail on the PortalServletFilter setting in Oracle Enterprise Pack for Eclipse by right-clicking the web.xml file, choosing Compare With > J2EE Library Version, and double-clicking p13n-web-lib in the Compare editor. The editor shows the p13n-web-lib version in one of the panes.


    Tracking anonymous users can potentially generate a large amount of data. You might want to develop a strategy to remove old data. For example, you could delete entries from the database that are older than two months. If a tracked anonymous user is converted to a registered user, you could remove the tracked anonymous user EJB and its associated property set EJBs from the database.

7.3 Targeting Anonymous Non-Tracked Users

You can target anonymous non-tracked users with personalized content using a personalization tool, such as default (non-campaign) placeholders and content selectors. Campaigns and behavior tracking are not currently supported for anonymous, non-tracked users.


Campaigns and behavior tracking are not supported for anonymous users that have not logged in.

The difference between completely anonymous non-tracked users and registered or anonymous tracked users is how long their profile information is retained.

For example, if an anonymous user visits a portal and sets preferences to favorite color=purple and favorite hobby=reading, those values are persisted in memory and can be used to display personalized content and trigger campaigns while the browser session lasts. However, if the user closes the browser and revisits the portal, the user preferences must be re-entered. Registered and anonymous tracked user preferences are saved in a database.

While anonymous users might not retain a consistent store of user preferences from session to session, you can still provide some Interaction Management functionality. Many personalization conditions are based on generic HTTP session and request properties that you define, dates and times, or personal session preferences that have no relationship to registered users and their profile properties. For example, you could display personalized content for anonymous users accessing your portal with a specific type of browser during a specific time frame.

See the Oracle Fusion Middleware Interaction Management Guide for Oracle WebLogic Portal for instructions on setting up placeholders and content selectors for anonymous non-tracked users.