Class ClickStream

Represents the click stream in the session. A maximum number of 50 clicks is recorded per session. After the maximum is reached, each time the customer clicks on a new link, the oldest click stream entry is purged. The ClickStream always remembers the first click.

The click stream is consulted when the GetLastVisitedProducts pipelet is called to retrieve the products that the customer has recently visited.

Property Summary 

PropertyDescription
clicks: List (read-only)Returns a collection with all clicks.
enabled: Boolean (read-only)Identifies if the clickstream recording is enabled or not.
first: ClickStreamEntry (read-only)Returns the first click within this session.
last: ClickStreamEntry (read-only)Returns the last recorded click stream, which is also typically the current click.
partial: Boolean (read-only)Identifies if this is only a partial click stream.

Constructor Summary 

This class does not have a constructor, so you cannot create it directly.

Method Summary 

MethodDescription
getClicks()Returns a collection with all clicks.
getFirst()Returns the first click within this session.
getLast()Returns the last recorded click stream, which is also typically the current click.
isEnabled()Identifies if the clickstream recording is enabled or not.
isPartial()Identifies if this is only a partial click stream.

Methods inherited from class Object 

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

Property Details 

clicks 

clicks: List (read-only)

Returns a collection with all clicks. The first entry is the oldest entry. The last entry is the latest entry. The method returns a copy of the click stream, which makes it safe to work with the click stream, while it might be modified.


enabled 

enabled: Boolean (read-only)

Identifies if the clickstream recording is enabled or not. It is considered enabled if either:

  • the method Session.isTrackingAllowed()returns true
  • or if the above method returns false but the preference 'ClickstreamHonorDNT' is set to false.

When clickstream tracking is not enabled the getFirst() method still operates as expected but the rest of the clicks are not collected.


first 

first: ClickStreamEntry (read-only)

Returns the first click within this session. This first click is stored independent of whether entries are purged.


last 

last: ClickStreamEntry (read-only)

Returns the last recorded click stream, which is also typically the current click. In where rare cases (e.g. RedirectURL pipeline) this is not the current click, but instead the last recorded click.


partial 

partial: Boolean (read-only)

Identifies if this is only a partial click stream. If the maximum number of clicks (50) is recorded, the oldest entry is automatically purged with each additional click. In this case, this flag indicates that the click stream is only partial.


Method Details 

getClicks() 

getClicks(): List

Returns a collection with all clicks. The first entry is the oldest entry. The last entry is the latest entry. The method returns a copy of the click stream, which makes it safe to work with the click stream, while it might be modified.

Returns:

  • a collection of ClickStreamEntry instances, sorted chronologically.

getFirst() 

getFirst(): ClickStreamEntry

Returns the first click within this session. This first click is stored independent of whether entries are purged.

Returns:

  • the first click within this session.

getLast() 

getLast(): ClickStreamEntry

Returns the last recorded click stream, which is also typically the current click. In where rare cases (e.g. RedirectURL pipeline) this is not the current click, but instead the last recorded click.

Returns:

  • the last recorded click stream, which is also typically the current click.

isEnabled() 

isEnabled(): Boolean

Identifies if the clickstream recording is enabled or not. It is considered enabled if either:

  • the method Session.isTrackingAllowed()returns true
  • or if the above method returns false but the preference 'ClickstreamHonorDNT' is set to false.

When clickstream tracking is not enabled the getFirst() method still operates as expected but the rest of the clicks are not collected.

Returns:

  • whether clickstream tracking is enabled

isPartial() 

isPartial(): Boolean

Identifies if this is only a partial click stream. If the maximum number of clicks (50) is recorded, the oldest entry is automatically purged with each additional click. In this case, this flag indicates that the click stream is only partial.

Returns:

  • true if this click stream is partial, false otherwise.