Property | Type | Description | |
---|---|---|---|
$cachedAnalytics |
Method | Description | |
---|---|---|
addCommerceCheckoutStep ( |
Add a checkout step and option to an Analytics object | |
addCommerceOrderToAnalytics ( |
Add a Craft Commerce OrderModel to an Analytics object | |
addCommerceProductDetailView ( |
Add a product detail view from a Craft Commerce Product or Variant | |
addCommerceProductImpression ( |
Add a product impression from a Craft Commerce Product or Variant | |
addProductDataFromLineItem ( $analytics = null, $lineItem = null, $index, $listName = "" ) : string | Add a Craft Commerce LineItem to an Analytics object | |
addToCart ( Commerce_OrderModel $orderModel = null, Commerce_LineItemModel $lineItem = null ) | Send analytics information for the item added to the cart | |
analytics ( ) : |
getAnalyticsObject() return an analytics object | |
eventAnalytics ( $eventCategory = "", $eventAction = "", $eventLabel = "", $eventValue ) : |
Get an Event analytics object | |
eventTrackingUrl ( string $url, string $eventCategory = "", string $eventAction = "", string $eventLabel = "", string $eventValue ) : string | Get an Event tracking URL | |
getGlobals ( $title ) : array | Get the global variables for our Twig context | |
getProductDataFromProduct ( $productVariant = null, $index, $listName = "" ) : array | Extract product data from a Craft Commerce Product or Variant | |
orderComplete ( Commerce_OrderModel $orderModel = null ) | Send analytics information for the completed order | |
pageViewAnalytics ( $url = "", $title = "" ) : |
Get a PageView analytics object | |
pageViewTrackingUrl ( string $url, string $title ) : string | Get a PageView tracking URL | |
removeFromCart ( $orderModel = null, $lineItem = null ) | Send analytics information for the item removed from the cart | |
shouldSendAnalytics ( ) : boolean | _shouldSendAnalytics determines whether we should be sending Google Analytics data |
Method | Description | |
---|---|---|
_gaGenUUID ( ) : string | _gaGenUUID Generate UUID v4 function - needed to generate a CID when one isn't available | |
_gaParseCookie ( ) : string | _gaParseCookie handles the parsing of the _ga cookie or setting it to a unique identifier | |
_getAnalyticsObj ( ) : |
Get the Google Analytics object, primed with the default values | |
_getGclid ( ) | _getGclid get the gclid and sets the 'gclid' cookie | |
_pullDataFromField ( $productVariant, $fieldHandle ) : string | Extract the value of a field |
public addCommerceCheckoutStep ( |
||
$analytics | the Analytics object | |
$orderModel | Commerce_OrderModel | the Product or Variant |
$step | integer | the checkout step |
$option | string | the checkout option |
public addCommerceOrderToAnalytics ( |
||
$analytics | the Analytics object | |
$orderModel | Commerce_OrderModel | the Product or Variant |
public addCommerceProductDetailView ( |
||
$analytics | the Analytics object |
public addCommerceProductImpression ( |
||
$analytics | the Analytics object | |
$index | integer | Where the product appears in the list |
public addProductDataFromLineItem ( $analytics = null, $lineItem = null, $index, $listName = "" ) : string | ||
return | string | the title of the product |
public addToCart ( Commerce_OrderModel $orderModel = null, Commerce_LineItemModel $lineItem = null ) | ||
$orderModel | Commerce_OrderModel | the Product or Variant |
$lineItem | Commerce_LineItemModel | the line item that was added |
public analytics ( ) : |
||
return | object |
public eventAnalytics ( $eventCategory = "", $eventAction = "", $eventLabel = "", $eventValue ) : |
||
return | object |
public eventTrackingUrl ( string $url, string $eventCategory = "", string $eventAction = "", string $eventLabel = "", string $eventValue ) : string | ||
$url | string | the URL to track |
$eventCategory | string | the event category |
$eventAction | string | the event action |
$eventLabel | string | the event label |
$eventValue | string | the event value |
return | string | the tracking URL |
public getGlobals ( $title ) : array | ||
return | array | with 'instantAnalytics' => Analytics object |
public getProductDataFromProduct ( $productVariant = null, $index, $listName = "" ) : array | ||
return | array | the product data |
public orderComplete ( Commerce_OrderModel $orderModel = null ) | ||
$orderModel | Commerce_OrderModel | the Product or Variant |
public pageViewAnalytics ( $url = "", $title = "" ) : |
||
return | object |
public removeFromCart ( $orderModel = null, $lineItem = null ) |
public shouldSendAnalytics ( ) : boolean | ||
return | boolean |