PHP Class kartik\social\GoogleAnalytics

Usage: echo GoogleAnalytics::widget([ 'id' => 'TRACKING_ID', 'domain' => 'TRACKING_DOMAIN' ]);
Since: 1.0
Author: Kartik Visweswaran ([email protected])
Inheritance: extends Widget
Datei anzeigen Open project: kartik-v/yii2-social Class Usage Examples

Public Properties

Property Type Description
$anonymizeIp the settings to anonymize the IP address of the hit (http request) sent to Google Analytics. One of the following values are supported: - 0 or GoogleAnalytics::HIT_NONE: The IP will not be anonymized. - 1 or GoogleAnalytics::HIT_ALL: Anonymize the IP addresses for all the hits sent from a page (the lifetime of the tracker object) - 2 or GoogleAnalytics::HIT_EACH: Anonymize the IP address of an individual hit
$domain the domain name of your website where the tracking code will be displayed
$id the Google Analytics Tracking ID
$jsAfterSend any javascript to append after the script that sends data
$jsBeforeSend any javascript to prepend before the script that sends data
$objectName the global object name. Defaults to __gaTracker.
$sendConfig the configuration for sending data. Set it as a string (to be used as is) or an associative array of $key => $value.
$testMode whether to enable test mode to automatically set cookieDomain. The test mode will auto default to YII_DEBUG definition.
$trackerConfig the tracker object configuration. Set it as a string (to be used as is) or an associative array of $key => $value.

Public Methods

Method Description
init ( ) Initialize the widget

Method Details

init() public method

Initialize the widget
public init ( )

Property Details

$anonymizeIp public_oe property

the settings to anonymize the IP address of the hit (http request) sent to Google Analytics. One of the following values are supported: - 0 or GoogleAnalytics::HIT_NONE: The IP will not be anonymized. - 1 or GoogleAnalytics::HIT_ALL: Anonymize the IP addresses for all the hits sent from a page (the lifetime of the tracker object) - 2 or GoogleAnalytics::HIT_EACH: Anonymize the IP address of an individual hit
public $anonymizeIp

$domain public_oe property

the domain name of your website where the tracking code will be displayed
public $domain

$id public_oe property

the Google Analytics Tracking ID
public $id

$jsAfterSend public_oe property

any javascript to append after the script that sends data
public $jsAfterSend

$jsBeforeSend public_oe property

any javascript to prepend before the script that sends data
public $jsBeforeSend

$objectName public_oe property

the global object name. Defaults to __gaTracker.
public $objectName

$sendConfig public_oe property

the configuration for sending data. Set it as a string (to be used as is) or an associative array of $key => $value.
See also: https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#send
public $sendConfig

$testMode public_oe property

whether to enable test mode to automatically set cookieDomain. The test mode will auto default to YII_DEBUG definition.
public $testMode

$trackerConfig public_oe property

the tracker object configuration. Set it as a string (to be used as is) or an associative array of $key => $value.
See also: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#create
public $trackerConfig