The first step to using Analytics functionality in your custom application is deciding which events are useful and what information you want to track. The Analytics database uses a standard star schema, providing almost unlimited flexibility in data storage.
You need to follow a few basic steps to define your event model:
You can also raise custom events and define your own parameters. A new fact table is created in the Analytics database for every custom event. For details on the Analytics database implementation, see the AquaLogic Interaction Analytics Database Schema in the product documentation.
Parameter Description USERID The ID of the user who triggers the event. You must use the OpenUsage API to set the User ID. TIMEID The unique ID number that is created for each occurrence of the event. This value is set by Analytics. VISITID The portal visit ID of the user who triggered the event. This parameter is only compatible with events that occur in the portal. This value is set by Analytics. OCCURRED The date and time when the event was generated. The format of the date/time stamp is determined by your database type. This value is set by Analytics.
All the interfaces in the OpenUsage API include methods to get and set standard parameters, including user ID, portlet ID, page ID, URL, and referer. For a complete list of the standard parameters for each event type, see the OpenUsage API documentation (javadoc). You can also create your own event parameters to capture data that is not defined by the delivered defaults.
The following examples describe event models.
Palo Alto Golf Course (PAGC) is setting up new classes and wants to see which topics users are most interested in. They decide to post a portlet listing three problem-specific articles on Golf Digest's Web site and track which of the links users click on the most. They also want to track users' skill levels since it is defined as a user property in their portal. Since the users are divided among three portal groups, PAGC also wants to track the users' group membership.
PAGC creates a portlet that displays links to the three articles. Each link points to a redirect page that calls the
sendEvent method in the OpenUsage API, passing the event type ID for that page, the date-time, and user ID. The redirect page redirects to the actual link target.
An administrator registers a custom event for the article click in Analytics Administration, along with the corresponding event parameters (event type ID, date-time, and user ID). The user ID parameter corresponds to the existing portal user dimension table, which includes skill level and group membership.
PAGC creates a report that displays which links were clicked most often, grouped by skill level or portal group.
BMW is working on a portal application for ordering car accessories online. The application allows users to browse a catalog of items, view details, add the items to a shopping cart, and purchase the items added to the cart. BMW would like to track the following statistics:
All events can be captured by calling the OpenUsage API from the portal application. The VIEW_ITEM event could also be captured by placing an OpenUsage event tag on the details page.
An administrator registers the five custom events in Analytics Administration:
BMW creates reports to display how many users clicked to browse the catalog, to display how many initiated shopping cart sessions, and to show details on how many times each item was viewed, added to a cart, and/or purchased.
Netformx Software has a knowledge base search portlet on its support page that allows users to search for a term in user manuals, articles, marketing material, and/or white papers. Netformx would like to know which of these four repositories is searched the most via the portlet.
The portlet calls the OpenUsageAPI when the Search button is clicked, passing in the appropriate knowledge repository as the event parameter. If more than one repository was selected, an event is sent for each selected repository.
If the portlet uses either the
ISearchEvent or the
IDirView interface to raise a standard portal event, there is no need to register a custom event in Analytics Administration.
Netformx creates a report to compare usage of the four repositories.
St. Paul Brewing Company is rolling out a new beer that has no carbs, no calories, and no taste. They plan on promoting the beer via e-mail and advertisements on Google and Yahoo. They would like statistics for the following:
As with the other examples, all events can be sent via an OpenUsage API call with appropriate parameters. Page visits can be tracked using OpenUsage tags. An administrator registers any custom events and custom event parameters in Analytics Administration. A range of reports can be created to display statistics from the campaign.