Write an aggregator for Active Site Analytics
We can write our own scripts to retrieve the data for Active Site Analytics from the portal themes and skins, and connect to the analytics service provider. Such scripts are called aggregators.
The portal themes that come with WebSphere Portal write the data that Active Site analytics needs into the markup. The data is provided in the form of microformats, which are injected into the markup during rendering.
The scripts that retrieve this data from the page markup are called aggregators. After retrieving the relevant microformat instances, the aggregator typically submits the collected data to an external analytics service where the data is then recorded, processed, and formatted in the form of reports. The portal provides a client side JavaScript SPI used to implement aggregators. The SPI is named Active Site Analytics Mediator SPI.
Aggregators based on the Active Site Analytics Mediator SPI behave consistently in WebSphere Portal, irrespective of the render mode of the portal page to which the aggregator is applied. This includes server side aggregation rendering and client side aggregation rendering modes. An aggregator can capture the latest data that is relevant for Active Site Analytics even in the client side aggregation mode that uses Ajax technologies to refresh individual page parts that are part of the DOM. Beyond that, the SPI also supports custom Ajax applications that can be part of a portal page.
From a programming model perspective, the Active Site Analytics Mediator SPI allows aggregator implementations to register callback functions; the portal framework calls these functions to notify the aggregator about DOM changes that can be relevant for Active Site Analytics. Upon receiving such notifications, aggregators can parse the DOM to find the relevant microformats to send this information to the analytics service.
For typical portal pages use the Active Site Analytics Mediator SPI for implementing the aggregators. However, for simpler pages we can also implement the aggregator using a simple inline script which is executed at the end of the portal page. In this case the page must fulfill both of the following conditions:
- The page does not exploit client side aggregation rendering.
- Your applications on the page do not use Ajax technologies to refresh single page parts that might contain analytics-relevant microformats.
The SPI does not affect the way we can configure aggregators.
- The Active Site Analytics Mediator SPI
- Guidelines for implementing an aggregator
- Aggregator patterns and samples
- How to identify and resolve problems with the aggregator
Parent Collect analytics dataRelated tasks:
Add an Active Site Analytics aggregator to a portal page