Expand all

ViewLogger

Tracks how long users are viewing images for

Constructor

new ViewLogger(windowObject) #

Parameters:

Name Type Description
windowObject Object

Browser window object

Source:

Properties

url :string #

The image URL to record a virtual view for

Type:

  • string
Source:
The image URL to record a virtual view for

viewDuration :number #

How long the user has been looking at the current image

Type:

  • number
Source:
How long the user has been looking at the current image

viewStartTime :number #

Record when the user started looking at the current image

Type:

  • number
Source:
Record when the user started looking at the current image

wasLastViewLogged :boolean #

Was the last image view logged or was logging skipped?

Type:

  • boolean
Source:
Was the last image view logged or was logging skipped?

window :Object #

Browser window

Type:

Source:
Browser window

Methods

attach(url) #

Sets up the view tracking for the current image

Parameters:

Name Type Description
url string

URL of the image to record a virtual view for

Source:
Sets up the view tracking for the current image

recordViewDuration() #

Records the amount of time the current image has been viewed

Source:
Records the amount of time the current image has been viewed

setLastViewLogged(wasEventLogged) #

Tracks whether or not the image view event was logged or not (i.e. was it in the logging sample)

Parameters:

Name Type Description
wasEventLogged boolean

Whether the image view event was logged

Source:
Tracks whether or not the image view event was logged or not (i.e.

startViewDuration() #

Starts recording a viewing window for the current image

Source:
Starts recording a viewing window for the current image

stopViewDuration() #

Stops recording the viewing window for the current image

Source:
Stops recording the viewing window for the current image

unattach() #

Stops listening to events

Source:
Stops listening to events

unview() #

Tracks the unview event of the current image if appropriate

Source:
Tracks the unview event of the current image if appropriate