This article covers a Bloomreach Experience Manager version 11. There's an updated version available that covers our most recent release.

Augmenting RequestLog Data

Some pieces of data cannot be easily collected by collectors, invoked from the targeting valve, without compromising the design of the site application.  This data may not be needed for targeting, but is for example used in custom analysis.  For that scenario, there is an alternative way to store data in a request log entry.

The essence of the matter is captured by the following piece of code:

private void storeValueAtKey(String key, Object value) {
  TargetingState state = TargetingStateProvider.get();
  RequestLogEntry entry = state.getRequestLogEntry();
  Map<String, Object> data = entry.getData();
  data.put(key, value);

To prevent collisions with other pieces of code doing collection you need to make sure that the key is sufficiently unique. The object data that you put need to be POJOs that can be mapped from Java to JSON and vice versa via com.fasterxml.jackson.databind.ObjectMapper. Note that the serialized data will be written to the request log that is in turned stored in Request Relevance Data Store, thus make sure to  not store large objects as this might severly impact performance and storage.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?

    We rely on cookies

    to optimize our communication and to enhance your customer experience. By clicking on the Accept and Close button, you agree to the collection of cookies. You can also adjust your preferences by clicking on Manage Preferences. For more information please see our Privacy policy.

    Manage cookies
    Accept & close

    Cookies preferences

    Accept & close