GoogleAnalytics
extends AbstractHelper
in package
GoogleAnalytics view helper
Tags
Table of Contents
- $createOptions : string
- Options to pass to the ga() create command.
- $key : string|bool
- API key (false if disabled)
- __construct() : mixed
- Constructor
- __invoke() : string
- Returns GA code (if active) or empty string if not.
- getRawJavascript() : string
- Returns GA Javascript code.
Properties
$createOptions
Options to pass to the ga() create command.
protected
string
$createOptions
$key
API key (false if disabled)
protected
string|bool
$key
Methods
__construct()
Constructor
public
__construct(string|bool $key[, bool|array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $key : string|bool
-
API key (false if disabled)
- $options : bool|array<string|int, mixed> = []
-
Configuration options (supported options: 'universal' and 'create_options_js'). If a boolean is provided instead of an array, that value is used as the 'universal' setting and no other options are set (for backward compatibility).
Return values
mixed —__invoke()
Returns GA code (if active) or empty string if not.
public
__invoke([string $customUrl = false ]) : string
Parameters
- $customUrl : string = false
-
override URL to send to Google Analytics
Return values
string —getRawJavascript()
Returns GA Javascript code.
protected
getRawJavascript([string $customUrl = false ]) : string
Parameters
- $customUrl : string = false
-
override URL to send to Google Analytics