Add an analytics call
array
addCall
(string $method, [array $params = array()])
-
string
$method: The name of the function
-
array
$params: The parameters for the call
Add a custom variable to the analytics
array
addCustomVar
(int $slot, string $name, string $value, [int $scope = 3])
-
int
$slot: The slot to store the variable in (1-5)
-
string
$name: The variable name
-
string
$value: The variable value
-
int
$scope: The scope of the variable (1: visitor level, 2: session level, 3: page level)
Track an analytics event
array
addEvent
(string $category, string $action, [string $label = null], [string $value = null], [boolean $noninteract = false])
-
string
$category: The general event category
-
string
$action: The event action
-
string
$label: The event description
-
string
$value: The value of the event
-
boolean
$noninteract: Don't allow this event to impact bounce statistics
Create a javascript function from the call parameters
string
createCall
(string $method, [array $params = array()])
-
string
$method: The name of the function
-
array
$params: The parameters for the call
Get the code to create a custom analytics variable
string
createCustomVar
(int $slot, string $name, string $value, [int $scope = 3])
-
int
$slot: The slot to store the variable in (1-5)
-
string
$name: The variable name
-
string
$value: The variable value
-
int
$scope: The scope of the variable (1: visitor level, 2: session level, 3: page level)
Get the code to track an analytics event
string
createEvent
(string $category, string $action, [string $label = null], [string $value = null], [boolean $noninteract = false])
-
string
$category: The general event category
-
string
$action: The event action
-
string
$label: The event description
-
string
$value: The value of the event
-
boolean
$noninteract: Don't allow this event to impact bounce statistics
Delete a call from the stack
array
deleteCall
([int $index = null])
-
int
$index: Index of call to delete (defaults to last added call)
Google Analytics only needs to be included in the header
null
getBody
()
Redefinition of:
- JGoogleEmbed::getBody()
- Method to retrieve the body for the API
Method to get the tracking code
string
getCode
()
Get code to load Google Analytics javascript
string
getHeader
()
Redefinition of:
- JGoogleEmbed::getHeader()
- Method to retrieve the header for the API
Checks if the javascript is set to be asynchronous
boolean
isAsync
()
List the analytics calls to be executed
array
listCalls
()
Method to set the tracking code
-
string
$code: The Google Analytics tracking code
Load javascript asynchronously
Load javascript synchronously
Inherited Methods
Inherited From JGoogleEmbed
JGoogleEmbed::__construct()
JGoogleEmbed::echoBody()
JGoogleEmbed::echoHeader()
JGoogleEmbed::getBody()
JGoogleEmbed::getHeader()
JGoogleEmbed::getOption()
JGoogleEmbed::isSecure()
JGoogleEmbed::setOption()