Namespace: onLinkExposureData

linkExposure.onLinkExposureData

An event that fires when a complete set of data about link exposures on a page is available. This event only fires once per page, after the page visit has ended.

Source:

Methods

(static) addListener(listener, options)

Add a listener for the onLinkExposureData event.

Parameters:
Name Type Description
listener linkExposureDataListener

The listener to add.

options Object

Options for the listener.

Properties
Name Type Attributes Default Description
linkMatchPatterns Array.<string>

Match patterns for links where the listener should receive individual resolved URLs. Links that do not match this match pattern are included in an aggregate count.

pageMatchPatterns Array.<string>

Match patterns for pages where the listener should be provided link exposure data.

privateWindows boolean <optional>
false

Whether to measure links in private windows.

Source:

(static) hasAnyListeners() → {boolean}

Whether the onLinkExposureData event has any listeners.

Source:
Returns:

Whether the event has any listeners.

Type
boolean

(static) hasListener(listener) → {boolean}

Whether a specified listener has been added for the onLinkExposureData event.

Parameters:
Name Type Description
listener linkExposureDataListener

The listener to check.

Source:
Returns:

Whether the listener has been added for the event.

Type
boolean

(static) removeListener(listener)

Remove a listener for the onLinkExposureData event.

Parameters:
Name Type Description
listener linkExposureDataListener

The listener to remove.

Source:

Type Definitions

linkExposureDataListener(details)

A callback function for the link exposure data event.

Parameters:
Name Type Description
details Object

Additional information about the link exposure date event.

Properties
Name Type Description
pageId string

The ID for the page, unique across browsing sessions.

url string

The URL of the page, without any hash.

matchingLinkUrls Array.<string>

An array containing the resolved URLs of links on the page that the user was exposed to and that matched a provided match pattern.

nonmatchingLinkCount number

The number of resolved links on the page that the user was exposed to and that did not match a provided match pattern.

Source: