$configuration
$configuration : \FACTFinder\Core\ConfigurationInterface
This tracking adapter uses the new Tracking Interface for 6.11
The adapter classes could conceivably be placed in the \Core\Server namespace, but that would potentially discourage fiddling with and extending these classes. The adapters are main components of the external API of this library. Most other classes are just used to make the adapters work.
$configuration : \FACTFinder\Core\ConfigurationInterface
$request : \FACTFinder\Core\Server\Request
$urlBuilder : \FACTFinder\Core\Client\UrlBuilder
$lastResponse : \FACTFinder\Core\Server\Response
__construct(string $loggerClass, \FACTFinder\Core\ConfigurationInterface $configuration, \FACTFinder\Core\Server\Request $request, \FACTFinder\Core\Client\UrlBuilder $urlBuilder, \FACTFinder\Core\AbstractEncodingConverter $encodingConverter = null)
| string | $loggerClass | Class name of logger to use. The class should implement FACTFinder\Util\LoggerInterface. |
| \FACTFinder\Core\ConfigurationInterface | $configuration | Configuration object to use. |
| \FACTFinder\Core\Server\Request | $request | The request object from which to obtain the server data. |
| \FACTFinder\Core\Client\UrlBuilder | $urlBuilder | Client URL builder object to use. |
| \FACTFinder\Core\AbstractEncodingConverter | $encodingConverter | Encoding converter object to use |
doTrackingFromRequest(string $sid = null, string $userId = null) : boolean
If all needed parameters are available at the request like described in the documentation, just use this method to fetch the needed parameters and track them. Make sure to set a session id if there is no parameter "sid". If this argument is not set or empty and the parameter "sid" is not available, it will try to use session_id() to fetch one.
| string | $sid | session id |
| string | $userId | id of user |
Success?
setupTrackingFromRequest(string $sid = null, string $userId = null)
Use this method directly if you want to separate the setup from sending the request. This is particularly useful when using the MultiCurlRequestFactory.
| string | $sid | session id |
| string | $userId | id of user |
trackClick(string $id, string $query, integer $pos, string $masterId = null, string $sid = null, string $cookieId = null, integer $origPos = -1, integer $page = 1, float $simi = 100.0, string $title = '', integer $pageSize = 12, integer $origPageSize = -1, string $userId = null, string $campaign = null, boolean $instoreAds = false) : boolean
Track a detail click on a product.
| string | $id | tracking id of product (see field with the role "Product number for tracking") |
| string | $query | query which led to the product |
| integer | $pos | position of product in the search result |
| string | $masterId | master id of the product (see field with the role "Master article number") |
| string | $sid | session id (if empty, then try to set using the function session_id() ) |
| string | $cookieId | cookie id (optional) |
| integer | $origPos | original position of product in the search result. this data is delivered by FACT-Finder (optional - is set equals to $position by default) |
| integer | $page | page number where the product was clicked (optional - is 1 by default) |
| float | $simi | similiarity of the product (optional - is 100.00 by default) |
| string | $title | title of product (optional - is empty by default) |
| integer | $pageSize | size of the page where the product was found (optional - is 12 by default) |
| integer | $origPageSize | original size of the page before the user could have changed it (optional - is set equals to $page by default) |
| string | $userId | id of user (optional if modul personalisation is not used) |
| string | $campaign | campaign name (optional) |
| boolean | $instoreAds | determines whether it's a sponsered product (optional) |
$success
setupClickTracking( $id, $query, $pos, $masterId = null, $sid = null, $cookieId = null, $origPos = -1, $page = 1, $simi = 100.0, $title = '', $pageSize = 12, $origPageSize = -1, $userId = null, $campaign = null, $instoreAds = false)
Use this method directly if you want to separate the setup from sending the request. This is particularly useful when using the MultiCurlRequestFactory.
| $id | ||
| $query | ||
| $pos | ||
| $masterId | ||
| $sid | ||
| $cookieId | ||
| $origPos | ||
| $page | ||
| $simi | ||
| $title | ||
| $pageSize | ||
| $origPageSize | ||
| $userId | ||
| $campaign | ||
| $instoreAds |
trackCart(string $id, string $masterId = null, $title = '', string $query = null, string $sid = null, string $cookieId = null, integer $count = 1, float $price = null, string $userId = null, string $campaign = null, boolean $instoreAds = false) : boolean
Track a product which was added to the cart.
| string | $id | tracking id of product (see field with the role "Product number for tracking") |
| string | $masterId | master id of the product (see field with the role "Master article number") |
| $title | ||
| string | $query | query which led to the product (only if module Semantic Enhancer is used) |
| string | $sid | session id (if empty, then try to set using the function session_id() ) |
| string | $cookieId | cookie id (optional) |
| integer | $count | number of items purchased for each product (optional - default 1) |
| float | $price | this is the single unit price (optional) |
| string | $userId | id of user (optional if modul personalisation is not used) |
| string | $campaign | campaign name (optional) |
| boolean | $instoreAds | determines whether it's a sponsered product (optional) |
$success
setupCartTracking( $id, $masterId = null, $title = '', $query = null, $sid = null, $cookieId = null, $count = 1, $price = null, $userId = null, $campaign = null, $instoreAds = false)
Use this method directly if you want to separate the setup from sending the request. This is particularly useful when using the MultiCurlRequestFactory.
| $id | ||
| $masterId | ||
| $title | ||
| $query | ||
| $sid | ||
| $cookieId | ||
| $count | ||
| $price | ||
| $userId | ||
| $campaign | ||
| $instoreAds |
trackCheckout(string $id, string $masterId = null, $title = '', string $query = null, string $sid = null, string $cookieId = null, integer $count = 1, float $price = null, string $userId = null, string $campaign = null, boolean $instoreAds = false) : boolean
Track a product which was purchased.
| string | $id | tracking id of product (see field with the role "Product number for tracking") |
| string | $masterId | master id of the product (see field with the role "Master article number") |
| $title | ||
| string | $query | query which led to the product (only if module Semantic Enhancer is used) |
| string | $sid | session id (if empty, then try to set using the function session_id() ) |
| string | $cookieId | cookie id (optional) |
| integer | $count | number of items purchased for each product (optional - default 1) |
| float | $price | this is the single unit price (optional) |
| string | $userId | id of user (optional if modul personalisation is not used) |
| string | $campaign | campaign name (optional) |
| boolean | $instoreAds | determines whether it's a sponsered product (optional) |
$success
setupCheckoutTracking( $id, $masterId = null, $title = '', $query = null, $sid = null, $cookieId = null, $count = 1, $price = null, $userId = null, $campaign = null, $instoreAds = false)
Use this method directly if you want to separate the setup from sending the request. This is particularly useful when using the MultiCurlRequestFactory.
| $id | ||
| $masterId | ||
| $title | ||
| $query | ||
| $sid | ||
| $cookieId | ||
| $count | ||
| $price | ||
| $userId | ||
| $campaign | ||
| $instoreAds |
trackRecommendationClick(string $id, integer $mainId, string $masterId = null, string $sid = null, string $cookieId = null, string $userId = null) : boolean
Track a click on a recommended product.
| string | $id | tracking id of product (see field with the role "Product number for tracking") |
| integer | $mainId | ID of the product for which the clicked-upon item was recommended |
| string | $masterId | master id of the product (see field with the role "Master article number") |
| string | $sid | session id (if empty, then try to set using the function session_id() ) |
| string | $cookieId | cookie id (optional) |
| string | $userId | id of user (optional if modul personalisation is not used) |
$success
setupRecommendationClickTracking( $id, $mainId, $masterId = null, $sid = null, $cookieId = null, $userId = null)
Use this method directly if you want to separate the setup from sending the request. This is particularly useful when using the MultiCurlRequestFactory.
| $id | ||
| $mainId | ||
| $masterId | ||
| $sid | ||
| $cookieId | ||
| $userId |
trackLogin(string $sid = null, string $cookieId = null, string $userId = null) : boolean
Track login of a user
| string | $sid | session id (if empty, then try to set using the function session_id() ) |
| string | $cookieId | cookie id (optional) |
| string | $userId | id of user who logged in |
$success
useResponseContentProcessor(object $callable)
Pass in a function to process the response content. This method is not used within the library, but may be convenient when writing custom adapters.
| object | $callable | A function (or invokable object) that processes a single string parameter. |
if $callable is not callable.