The Clicks
plugin tracks all mouse clicks on a page and beacons them to a dedicated endpoint on your server.
For information on how to include this plugin, see the Building tutorial.
Beacon Parameters
The following parameters are sent when a click event is triggered.
element
: ThenodeName
of the element that has been clicked (ie.A
,BUTTON
,NAV
, etc.)id
: Theid
of the element if specifiedclass
: Theclass
attribute of the elementdocument_height
: The height of thedocument
document_width
: The width of thedocument
viewport_height
: The height of the viewport when theclick
event was triggeredviewport_width
: The width of the viewport when theclick
event was triggered
Methods
-
init(config)
-
Initializes the plugin.
Parameters:
Name Type Description config
object Configuration
Properties
Name Type Argument Description Clicks.click_url
string The URL the click events will be beaconed to.
Clicks.onbeforeunload
boolean <optional>
A boolean value for when to send click events. If this is
true
, clicks will be sent when the page is unloaded. Otherwise, click events are sent immediately as they occur.Returns:
BOOMR.plugins.Clicks
The Clicks plugin for chaining -
is_complete()
-
This plugin is always complete (ready to send a beacon)
Returns:
Type: boolean
true