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 #

The image URL to record a virtual view for

Properties:

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

viewDuration #

How long the user has been looking at the current image

Properties:

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

viewStartTime #

Record when the user started looking at the current image

Properties:

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

wasLastViewLogged #

Was the last image view logged or was logging skipped?

Properties:

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

window #

Browser window

Properties:

Type Description
Object
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