-
Notifications
You must be signed in to change notification settings - Fork 8
Javascript reference
This page details all functions of the _wt1Q Javascript API
- trackPage
- trackEvent
- setVisitorParam
- delVisitorParam
- clearVisitorParams
- setSessionParam
- delSessionParam
- clearSessionParams
- setSizeCapture
Tracks the view of a page.
Takes an optional argument (Javascript object) to set custom variables for the page view.
/* Without custom variables */
_wt1Q.push(["trackPage"]);
/* With event-scoped custom variables */
_wt1Q.push(["trackPage", { "myvar" : "myvalue", "myvar2" : "myvalue2" }]);
Tracks a custom event on the page. This method can be called from any Javascript code.
Takes an optional argument (Javascript object) to set custom variables for the event.
/* Without custom variables */
_wt1Q.push(["trackEvent"]);
/* With event-scoped custom variables */
_wt1Q.push(["trackEvent", { "myvar" : "myvalue", "myvar2" : "myvalue2" }]);
Sets a visitor-scoped custom parameter.
CAUTION: This method actually only enqueues an order to clear the parameters. The parameters will be actually cleared on the subsequent call to trackPage
or trackEvent
.
Takes two arguments:
- Parameter name
- Parameter value
Example:
_wt1Q.push(["setVisitorParam", "myVisitorId", "value"]);
The parameter will be set on all subsequent tracking calls.
Removes a visitor-scoped custom parameter.
CAUTION: This method actually only enqueues an order to clear the parameters. The parameters will be actually cleared on the subsequent call to trackPage
or trackEvent
.
Takes one argument: the name of the parameter to delete.
Example:
_wt1Q.push(["delVisitorParam", "myVisitorId"]);
The parameter will be removed on all subsequent tracking calls.
Removes all visitor-scoped custom parameters.
CAUTION: This method actually only enqueues an order to clear the parameters. The parameters will be actually cleared on the subsequent call to trackPage
or trackEvent
.
Takes no arguments.
Example:
_wt1Q.push(["clearVisitorParams"]);
The parameters will be removed on all subsequent tracking calls.
Sets a session-scoped custom parameter.
CAUTION: This method actually only enqueues an order to clear the parameters. The parameters will be actually cleared on the subsequent call to trackPage
or trackEvent
.
Takes two arguments :
- Parameter name
- Parameter value
Example:
_wt1Q.push(["setSessionParam", "mySessionId", "value"]);
The parameter will be set on all subsequent tracking calls.
Removes a session-scoped custom parameter.
CAUTION: This method actually only enqueues an order to clear the parameters. The parameters will be actually cleared on the subsequent call to trackPage
or trackEvent
.
Takes one argument: the name of the parameter to delete.
Example:
_wt1Q.push(["delSessionParam", "mySessionId"]);
The parameter will be removed on all subsequent tracking calls.
Removes all session-scoped custom parameters.
CAUTION: This method actually only enqueues an order to clear the parameters. The parameters will be actually cleared on the subsequent call to trackPage
or trackEvent
.
Example:
_wt1Q.push(["clearSessionParams"]);
The parameters will be removed on all subsequent tracking calls.
Enables or disable the capture of browser and screen size. Size capture is enabled by default.
The parameter is not preserved across page loads.
Takes one argument: "true" or "false".
Example:
/* Disable size capture */
_wt1Q.push(["setSizeCapture", "false"]);