PiwikTracker

PiwikTracker implements the Piwik Tracking Web API.

The PHP Tracking Client provides all features of the Javascript Tracker, such as Ecommerce Tracking, Custom Variable, Event tracking and more. Functions are named the same as the Javascript functions.

See introduction docs at: http://piwik.org/docs/tracking-api/

Example: using the PHP PiwikTracker class

The following code snippet is an advanced example of how to track a Page View using the Tracking API PHP client.

 $t = new PiwikTracker( $idSite = 1, 'http://example.org/piwik/');

 // Optional function calls
 $t->setUserAgent( "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB) Firefox/3.6.6");
 $t->setBrowserLanguage('fr');
 $t->setLocalTime( '12:34:06' );
 $t->setResolution( 1024, 768 );
 $t->setBrowserHasCookies(true);
 $t->setPlugins($flash = true, $java = true, $director = false);

 // set a Custom Variable called 'Gender'
 $t->setCustomVariable( 1, 'gender', 'male' );

 // If you want to force the visitor IP, or force the server date time to a date in the past,
 // it is required to authenticate the Tracking request by calling setTokenAuth
 // You can pass the Super User token_auth or any user with 'admin' privilege on the website $idSite
 $t->setTokenAuth( $token_auth );
 $t->setIp( "134.10.22.1" );
 $t->setForceVisitDateTime( '2011-04-05 23:55:02' );

 // if you wanted to force to record the page view or conversion to a specific User ID
 // $t->setUserId( "username@example.org" );
 // Mandatory: set the URL being tracked
 $t->setUrl( $url = 'http://example.org/store/list-category-toys/' );

 // Finally, track the page view with a Custom Page Title
 // In the standard JS API, the content of the <title> tag would be set as the page title
 $t->doTrackPageView('This is the page title');

Example: tracking Ecommerce interactions

Here is an example showing how to track Ecommerce interactions on your website, using the PHP Tracking API. Usually, Ecommerce tracking is done using standard Javascript code, but it is very common to record Ecommerce interactions after the fact (for example, when payment is done with Paypal and user doesn't come back on the website after purchase). For more information about Ecommerce tracking in Piwik, check out the documentation: Tracking Ecommerce in Piwik.

 $t = new PiwikTracker( $idSite = 1, 'http://example.org/piwik/');

 // Force IP to the actual visitor IP
 $t->setTokenAuth( $token_auth );
 $t->setIp( "134.10.22.1" );

 // Example 1: on a Product page, track an "Ecommerce Product view"
 $t->setUrl( $url = 'http://www.mystore.com/Endurance-Shackletons-Legendary-Antarctic-Expedition' );
 $t->setEcommerceView($sku = 'SKU0011', $name = 'Endurance - Shackleton', $category = 'Books');
 $t->doTrackPageView( 'Endurance Shackletons Legendary Antarctic Expedition - Mystore.com');

 // Example 2: Tracking Ecommerce Cart containing 2 products
 $t->addEcommerceItem($sku = 'SKU0011', $name = 'Endurance - Shackleton' , $category = 'Books', $price = 17, $quantity = 1);
 // Note that when setting a product category, you can specify an array of up to 5 categories to track for this product
 $t->addEcommerceItem($sku = 'SKU0321', $name = 'Amélie' , $categories = array('DVD Foreign','Best sellers','Our pick'), $price = 25, $quantity = 1);
 $t->doTrackEcommerceCartUpdate($grandTotal = 42);

 // Example 3: Tracking Ecommerce Order
 $t->addEcommerceItem($sku = 'SKU0011', $name = 'Endurance - Shackleton' , $category = 'Books', $price = 17, $quantity = 1);
 $t->addEcommerceItem($sku = 'SKU0321', $name = 'Amélie' , $categories = array('DVD Foreign','Best sellers','Our pick'), $price = 25, $quantity = 1);
 $t->doTrackEcommerceOrder($orderId = 'B000111387', $grandTotal = 55.5, $subTotal = 42, $tax = 8, $shipping = 5.5, $discount = 10);

Note: authenticating with the token_auth

To set the visitor IP, or the date and time of the visit, or to force to record the visit (or page, or goal conversion) to a specific Visitor ID, you must call setTokenAuth( $token_auth ). The token_auth must be either the Super User token_auth, or the token_auth of any user with 'admin' permission for the website you are recording data against.

Properties

This class defines the following properties:

  • $URL — Piwik base URL, for example http://example.org/piwik/ Must be set before using the class by calling PiwikTracker::$URL = 'http://yourwebsite.org/piwik/';
  • $DEBUG_APPEND_URL
  • $DEBUG_LAST_REQUESTED_URL — Used in tests to output useful error messages.

$URL

Piwik base URL, for example http://example.org/piwik/ Must be set before using the class by calling PiwikTracker::$URL = 'http://yourwebsite.org/piwik/';

Signature

  • It is a string value.

$DEBUG_APPEND_URL

Signature

  • Its type is not specified.

$DEBUG_LAST_REQUESTED_URL

Used in tests to output useful error messages.

Signature

  • Its type is not specified.

Methods

The class defines the following methods:

__construct()

Builds a PiwikTracker object, used to track visits, pages and Goal conversions for a specific website, by using the Piwik Tracking API.

Signature

  • It accepts the following parameter(s):
  • $idSite (int) —

    Id site to be tracked

  • $apiUrl (string) —

    "http://example.org/piwik/" or "http://piwik.example.org/" If set, will overwrite PiwikTracker::$URL

setPageCharset()

By default, Piwik expects utf-8 encoded values, for example for the page URL parameter values, Page Title, etc.

It is recommended to only send UTF-8 data to Piwik. If required though, you can also specify another charset using this function.

Signature

  • It accepts the following parameter(s):
  • $charset (string) —

  • It does not return anything.

setUrl()

Sets the current URL being tracked

Signature

  • It accepts the following parameter(s):
  • $url (string) —

    Raw URL (not URL encoded)

  • It does not return anything.

setUrlReferrer()

Sets the URL referrer used to track Referrers details for new visits.

Signature

  • It accepts the following parameter(s):
  • $url (string) —

    Raw URL (not URL encoded)

  • It does not return anything.

setGenerationTime()

Sets the time that generating the document on the server side took.

Signature

  • It accepts the following parameter(s):
  • $timeMs (int) —

    Generation time in ms

  • It does not return anything.

setUrlReferer()

Signature

  • It accepts the following parameter(s):
  • $url

  • It does not return anything.

setAttributionInfo()

Sets the attribution information to the visit, so that subsequent Goal conversions are properly attributed to the right Referrer URL, timestamp, Campaign Name & Keyword.

This must be a JSON encoded string that would typically be fetched from the JS API: piwikTracker.getAttributionInfo() and that you have JSON encoded via JSON2.stringify()

If you call enableCookies() then these referral attribution values will be set to the 'ref' first party cookie storing referral information.

See Also

  • function — getAttributionInfo() in https://github.com/piwik/piwik/blob/master/js/piwik.js

Signature

  • It accepts the following parameter(s):
  • $jsonEncoded (string) —

    JSON encoded array containing Attribution info

  • It does not return anything.
  • It throws one of the following exceptions:

setCustomVariable()

Sets Visit Custom Variable.

See http://piwik.org/docs/custom-variables/

Signature

  • It accepts the following parameter(s):
  • $id (int) —

    Custom variable slot ID from 1-5

  • $name (string) —

    Custom variable name

  • $value (string) —

    Custom variable value

  • $scope (string) —

    Custom variable scope. Possible values: visit, page, event

  • It does not return anything.
  • It throws one of the following exceptions:

getCustomVariable()

Returns the currently assigned Custom Variable.

If scope is 'visit', it will attempt to read the value set in the first party cookie created by Piwik Tracker ($_COOKIE array).

See Also

  • Piwik.js — getCustomVariable()

Signature

  • It accepts the following parameter(s):
  • $id (int) —

    Custom Variable integer index to fetch from cookie. Should be a value from 1 to 5

  • $scope (string) —

    Custom variable scope. Possible values: visit, page, event

  • Returns: (mixed) —

    An array with this format: array( 0 => CustomVariableName, 1 => CustomVariableValue ) or false

  • It throws one of the following exceptions:

clearCustomVariables()

Clears any Custom Variable that may be have been set.

This can be useful when you have enabled bulk requests, and you wish to clear Custom Variables of 'visit' scope.

Signature

  • It does not return anything.

setNewVisitorId()

Sets the current visitor ID to a random new one.

Signature

  • It does not return anything.

setIdSite()

Sets the current site ID.

Signature

  • It accepts the following parameter(s):
  • $idSite (int) —

  • It does not return anything.

setBrowserLanguage()

Sets the Browser language.

Used to guess visitor countries when GeoIP is not enabled

Signature

  • It accepts the following parameter(s):
  • $acceptLanguage (string) —

    For example "fr-fr"

  • It does not return anything.

setUserAgent()

Sets the user agent, used to detect OS and browser.

If this function is not called, the User Agent will default to the current user agent.

Signature

  • It accepts the following parameter(s):
  • $userAgent (string) —

  • It does not return anything.

setCountry()

Sets the country of the visitor.

If not used, Piwik will try to find the country using either the visitor's IP address or language.

Allowed only for Admin/Super User, must be used along with setTokenAuth().

Signature

  • It accepts the following parameter(s):
  • $country (string) —

  • It does not return anything.

setRegion()

Sets the region of the visitor.

If not used, Piwik may try to find the region using the visitor's IP address (if configured to do so).

Allowed only for Admin/Super User, must be used along with setTokenAuth().

Signature

  • It accepts the following parameter(s):
  • $region (string) —

  • It does not return anything.

setCity()

Sets the city of the visitor.

If not used, Piwik may try to find the city using the visitor's IP address (if configured to do so).

Allowed only for Admin/Super User, must be used along with setTokenAuth().

Signature

  • It accepts the following parameter(s):
  • $city (string) —

  • It does not return anything.

setLatitude()

Sets the latitude of the visitor.

If not used, Piwik may try to find the visitor's latitude using the visitor's IP address (if configured to do so).

Allowed only for Admin/Super User, must be used along with setTokenAuth().

Signature

  • It accepts the following parameter(s):
  • $lat (float) —

  • It does not return anything.

setLongitude()

Sets the longitude of the visitor.

If not used, Piwik may try to find the visitor's longitude using the visitor's IP address (if configured to do so).

Allowed only for Admin/Super User, must be used along with setTokenAuth().

Signature

  • It accepts the following parameter(s):
  • $long (float) —

  • It does not return anything.

enableBulkTracking()

Enables the bulk request feature.

When used, each tracking action is stored until the doBulkTrack method is called. This method will send all tracking data at once.

Signature

  • It does not return anything.

enableCookies()

Enable Cookie Creation - this will cause a first party VisitorId cookie to be set when the VisitorId is set or reset

Signature

  • It accepts the following parameter(s):
  • $domain (string) —

    (optional) Set first-party cookie domain. Accepted values: example.com, *.example.com (same as .example.com) or subdomain.example.com

  • $path (string) —

    (optional) Set first-party cookie path

  • It does not return anything.

doTrackPageView()

Tracks a page view

Signature

  • It accepts the following parameter(s):
  • $documentTitle (string) —

    Page title as it will appear in the Actions > Page titles report

  • Returns: (mixed) —

    Response string or true if using bulk requests.

doTrackEvent()

Tracks an event

Signature

  • It accepts the following parameter(s):
  • $category (string) —

    The Event Category (Videos, Music, Games...)

  • $action (string) —

    The Event's Action (Play, Pause, Duration, Add Playlist, Downloaded, Clicked...)

  • $name (string) —

    (optional) The Event's object Name (a particular Movie name, or Song name, or File name...)

  • $value (float) —

    (optional) The Event's value

  • Returns: (mixed) —

    Response string or true if using bulk requests.

doTrackContentImpression()

Tracks a content impression

Signature

  • It accepts the following parameter(s):
  • $contentName (string) —

    The name of the content. For instance 'Ad Foo Bar'

  • $contentPiece (string) —

    The actual content. For instance the path to an image, video, audio, any text

  • $contentTarget (string|false) —

    (optional) The target of the content. For instance the URL of a landing page.

  • Returns: (mixed) —

    Response string or true if using bulk requests.

doTrackContentInteraction()

Tracks a content interaction.

Make sure you have tracked a content impression using the same content name and content piece, otherwise it will not count. To do so you should call the method doTrackContentImpression();

Signature

  • It accepts the following parameter(s):
  • $interaction (string) —

    The name of the interaction with the content. For instance a 'click'

  • $contentName (string) —

    The name of the content. For instance 'Ad Foo Bar'

  • $contentPiece (string) —

    The actual content. For instance the path to an image, video, audio, any text

  • $contentTarget (string|false) —

    (optional) The target the content leading to when an interaction occurs. For instance the URL of a landing page.

  • Returns: (mixed) —

    Response string or true if using bulk requests.

doTrackSiteSearch()

Tracks an internal Site Search query, and optionally tracks the Search Category, and Search results Count.

These are used to populate reports in Actions > Site Search.

Signature

  • It accepts the following parameter(s):
  • $keyword (string) —

    Searched query on the site

  • $category (string) —

    (optional) Search engine category if applicable

  • $countResults (bool|int) —

    (optional) results displayed on the search result page. Used to track "zero result" keywords.

  • Returns: (mixed) —

    Response or true if using bulk requests.

doTrackGoal()

Records a Goal conversion

Signature

  • It accepts the following parameter(s):
  • $idGoal (int) —

    Id Goal to record a conversion

  • $revenue (float) —

    Revenue for this conversion

  • Returns: (mixed) —

    Response or true if using bulk request

doTrackAction()

Tracks a download or outlink

Signature

  • It accepts the following parameter(s):
  • $actionUrl (string) —

    URL of the download or outlink

  • $actionType (string) —

    Type of the action: 'download' or 'link'

  • Returns: (mixed) —

    Response or true if using bulk request

addEcommerceItem()

Adds an item in the Ecommerce order.

This should be called before doTrackEcommerceOrder(), or before doTrackEcommerceCartUpdate(). This function can be called for all individual products in the cart (or order). SKU parameter is mandatory. Other parameters are optional (set to false if value not known). Ecommerce items added via this function are automatically cleared when doTrackEcommerceOrder() or getUrlTrackEcommerceOrder() is called.

Signature

  • It accepts the following parameter(s):
  • $sku (string) —

    (required) SKU, Product identifier

  • $name (string) —

    (optional) Product name

  • $category (string|array) —

    (optional) Product category, or array of product categories (up to 5 categories can be specified for a given product)

  • $price (float|int) —

    (optional) Individual product price (supports integer and decimal prices)

  • $quantity (int) —

    (optional) Product quantity. If not specified, will default to 1 in the Reports

  • It does not return anything.
  • It throws one of the following exceptions:

doTrackEcommerceCartUpdate()

Tracks a Cart Update (add item, remove item, update item).

On every Cart update, you must call addEcommerceItem() for each item (product) in the cart, including the items that haven't been updated since the last cart update. Items which were in the previous cart and are not sent in later Cart updates will be deleted from the cart (in the database).

Signature

  • It accepts the following parameter(s):
  • $grandTotal (float) —

    Cart grandTotal (typically the sum of all items' prices)

  • Returns: (mixed) —

    Response or true if using bulk request

doBulkTrack()

Sends all stored tracking actions at once.

Only has an effect if bulk tracking is enabled.

To enable bulk tracking, call enableBulkTracking().

Signature

  • Returns: (string) —

    Response

  • It throws one of the following exceptions:

doTrackEcommerceOrder()

Tracks an Ecommerce order.

If the Ecommerce order contains items (products), you must call first the addEcommerceItem() for each item in the order. All revenues (grandTotal, subTotal, tax, shipping, discount) will be individually summed and reported in Piwik reports. Only the parameters $orderId and $grandTotal are required.

Signature

  • It accepts the following parameter(s):
  • $orderId (string|int) —

    (required) Unique Order ID. This will be used to count this order only once in the event the order page is reloaded several times. orderId must be unique for each transaction, even on different days, or the transaction will not be recorded by Piwik.

  • $grandTotal (float) —

    (required) Grand Total revenue of the transaction (including tax, shipping, etc.)

  • $subTotal (float) —

    (optional) Sub total amount, typically the sum of items prices for all items in this order (before Tax and Shipping costs are applied)

  • $tax (float) —

    (optional) Tax amount for this order

  • $shipping (float) —

    (optional) Shipping amount for this order

  • $discount (float) —

    (optional) Discounted amount in this order

  • Returns: (mixed) —

    Response or true if using bulk request

setEcommerceView()

Sets the current page view as an item (product) page view, or an Ecommerce Category page view.

This must be called before doTrackPageView() on this product/category page. It will set 3 custom variables of scope "page" with the SKU, Name and Category for this page view. Note: Custom Variables of scope "page" slots 3, 4 and 5 will be used.

On a category page, you may set the parameter $category only and set the other parameters to false.

Tracking Product/Category page views will allow Piwik to report on Product & Categories conversion rates (Conversion rate = Ecommerce orders containing this product or category / Visits to the product or category)

Signature

  • It accepts the following parameter(s):
  • $sku (string) —

    Product SKU being viewed

  • $name (string) —

    Product Name being viewed

  • $category (string|array) —

    Category being viewed. On a Product page, this is the product's category. You can also specify an array of up to 5 categories for a given page view.

  • $price (float) —

    Specify the price at which the item was displayed

  • It does not return anything.

getUrlTrackPageView()

Builds URL to track a page view.

See Also

  • doTrackPageView()

Signature

  • It accepts the following parameter(s):
  • $documentTitle (string) —

    Page view name as it will appear in Piwik reports

  • Returns: (string) —

    URL to piwik.php with all parameters set to track the pageview

getUrlTrackEvent()

Builds URL to track a custom event.

See Also

  • doTrackEvent()

Signature

  • It accepts the following parameter(s):
  • $category (string) —

    The Event Category (Videos, Music, Games...)

  • $action (string) —

    The Event's Action (Play, Pause, Duration, Add Playlist, Downloaded, Clicked...)

  • $name (string) —

    (optional) The Event's object Name (a particular Movie name, or Song name, or File name...)

  • $value (float) —

    (optional) The Event's value

  • Returns: (string) —

    URL to piwik.php with all parameters set to track the pageview

getUrlTrackContentImpression()

Builds URL to track a content impression.

See Also

  • doTrackContentImpression()

Signature

  • It accepts the following parameter(s):
  • $contentName (string) —

    The name of the content. For instance 'Ad Foo Bar'

  • $contentPiece (string) —

    The actual content. For instance the path to an image, video, audio, any text

  • $contentTarget (string|false) —

    (optional) The target of the content. For instance the URL of a landing page.

  • Returns: (string) —

    URL to piwik.php with all parameters set to track the pageview

  • It throws one of the following exceptions:
    • Exception — In case $contentName is empty

getUrlTrackContentInteraction()

Builds URL to track a content impression.

See Also

  • doTrackContentInteraction()

Signature

  • It accepts the following parameter(s):
  • $interaction (string) —

    The name of the interaction with the content. For instance a 'click'

  • $contentName (string) —

    The name of the content. For instance 'Ad Foo Bar'

  • $contentPiece (string) —

    The actual content. For instance the path to an image, video, audio, any text

  • $contentTarget (string|false) —

    (optional) The target the content leading to when an interaction occurs. For instance the URL of a landing page.

  • Returns: (string) —

    URL to piwik.php with all parameters set to track the pageview

  • It throws one of the following exceptions:
    • Exception — In case $interaction or $contentName is empty

getUrlTrackSiteSearch()

Builds URL to track a site search.

See Also

  • doTrackSiteSearch()

Signature

  • It accepts the following parameter(s):
  • $keyword (string) —

  • $category (string) —

  • $countResults (int) —

  • It returns a string value.

getUrlTrackGoal()

Builds URL to track a goal with idGoal and revenue.

See Also

  • doTrackGoal()

Signature

  • It accepts the following parameter(s):
  • $idGoal (int) —

    Id Goal to record a conversion

  • $revenue (float) —

    Revenue for this conversion

  • Returns: (string) —

    URL to piwik.php with all parameters set to track the goal conversion

getUrlTrackAction()

Builds URL to track a new action.

See Also

  • doTrackAction()

Signature

  • It accepts the following parameter(s):
  • $actionUrl (string) —

    URL of the download or outlink

  • $actionType (string) —

    Type of the action: 'download' or 'link'

  • Returns: (string) —

    URL to piwik.php with all parameters set to track an action

setForceVisitDateTime()

Overrides server date and time for the tracking requests.

By default Piwik will track requests for the "current datetime" but this function allows you to track visits in the past. All times are in UTC.

Allowed only for Super User, must be used along with setTokenAuth()

See Also

  • setTokenAuth()

Signature

  • It accepts the following parameter(s):
  • $dateTime (string) —

    Date with the format 'Y-m-d H:i:s', or a UNIX timestamp

  • It does not return anything.

setForceNewVisit()

Forces Piwik to create a new visit for the tracking request.

By default, Piwik will create a new visit if the last request by this user was more than 30 minutes ago. If you call setForceNewVisit() before calling doTrack*, then a new visit will be created for this request.

Signature

  • It does not return anything.

setIp()

Overrides IP address

Allowed only for Super User, must be used along with setTokenAuth()

See Also

  • setTokenAuth()

Signature

  • It accepts the following parameter(s):
  • $ip (string) —

    IP string, eg. 130.54.2.1

  • It does not return anything.

setUserId()

Force the action to be recorded for a specific User.

The User ID is a string representing a given user in your system.

A User ID can be a username, UUID or an email address, or any number or string that uniquely identifies a user or client.

Signature

  • It accepts the following parameter(s):
  • $userId (string) —

    Any user ID string (eg. email address, ID, username). Must be non empty. Set to false to de-assign a user id previously set.

  • It does not return anything.
  • It throws one of the following exceptions:

getUserIdHashed()

Hash function used internally by Piwik to hash a User ID into the Visitor ID.

Note: matches implementation of Tracker\Request->getUserIdHashed()

Signature

  • It accepts the following parameter(s):
  • $id ($id) —

  • It returns a string value.

setVisitorId()

Forces the requests to be recorded for the specified Visitor ID.

Note: it is recommended to use ->setUserId($userId); instead.

Rather than letting Piwik attribute the user with a heuristic based on IP and other user fingeprinting attributes, force the action to be recorded for a particular visitor.

If you use both setVisitorId and setUserId, setUserId will take precedence. If not set, the visitor ID will be fetched from the 1st party cookie, or will be set to a random UUID.

Signature

  • It accepts the following parameter(s):
  • $visitorId (string) —

    16 hexadecimal characters visitor ID, eg. "33c31e01394bdc63"

  • It does not return anything.
  • It throws one of the following exceptions:

getVisitorId()

If the user initiating the request has the Piwik first party cookie, this function will try and return the ID parsed from this first party cookie (found in $_COOKIE).

If you call this function from a server, where the call is triggered by a cron or script not initiated by the actual visitor being tracked, then it will return the random Visitor ID that was assigned to this visit object.

This can be used if you wish to record more visits, actions or goals for this visitor ID later on.

Signature

  • Returns: (string) —

    16 hex chars visitor ID string

getUserId()

Returns the User ID string, which may have been set via: $v->setUserId('username@example.org');

Signature

  • It returns a bool value.

deleteCookies()

Deletes all first party cookies from the client

Signature

  • It does not return anything.

getAttributionInfo()

Returns the currently assigned Attribution Information stored in a first party cookie.

This function will only work if the user is initiating the current request, and his cookies can be read by PHP from the $_COOKIE array.

See Also

  • Piwik.js — getAttributionInfo()

Signature

  • Returns: (string) —

    JSON Encoded string containing the Referrer information for Goal conversion attribution. Will return false if the cookie could not be found

setTokenAuth()

Some Tracking API functionnality requires express authentication, using either the Super User token_auth, or a user with 'admin' access to the website.

The following features require access: - force the visitor IP - force the date & time of the tracking requests rather than track for the current datetime

Signature

  • It accepts the following parameter(s):
  • $token_auth (string) —

    token_auth 32 chars token_auth string

  • It does not return anything.

setLocalTime()

Sets local visitor time

Signature

  • It accepts the following parameter(s):
  • $time (string) —

    HH:MM:SS format

  • It does not return anything.

setResolution()

Sets user resolution width and height.

Signature

  • It accepts the following parameter(s):
  • $width (int) —

  • $height (int) —

  • It does not return anything.

setBrowserHasCookies()

Sets if the browser supports cookies This is reported in "List of plugins" report in Piwik.

Signature

  • It accepts the following parameter(s):
  • $bool (bool) —

  • It does not return anything.

setDebugStringAppend()

Will append a custom string at the end of the Tracking request.

Signature

  • It accepts the following parameter(s):
  • $string (string) —

  • It does not return anything.

setPlugins()

Sets visitor browser supported plugins

Signature

  • It accepts the following parameter(s):
  • $flash (bool) —

  • $java (bool) —

  • $director (bool) —

  • $quickTime (bool) —

  • $realPlayer (bool) —

  • $pdf (bool) —

  • $windowsMedia (bool) —

  • $gears (bool) —

  • $silverlight (bool) —

  • It does not return anything.

disableCookieSupport()

By default, PiwikTracker will read first party cookies from the request and write updated cookies in the response (using setrawcookie).

This can be disabled by calling this function.

Signature

  • It does not return anything.

getRequestTimeout()

Returns the maximum number of seconds the tracker will spend waiting for a response from Piwik.

Defaults to 600 seconds.

Signature

  • It does not return anything.

setRequestTimeout()

Sets the maximum number of seconds that the tracker will spend waiting for a response from Piwik.

Signature

  • It accepts the following parameter(s):
  • $timeout (int) —

  • It does not return anything.
  • It throws one of the following exceptions: