\GravityEvent

Describes an event for the recommendation engine, for example a user viewed an item.

Summary

Methods
Properties
Constants
__construct()
$eventType
$itemId
$recommendationId
$time
$userId
$cookieId
$nameValues
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$eventType

$eventType : string

The event type determines the namevalues which can be passed.

Possible list event types, which can be expanded based on what can the external system support:

Event TypeCategoryDescriptionNameValues for the event
VIEWGENERALThe user viewed the info page of an item.
BUYGENERALThe user bought an item.
OrderId
UnitPriceFormatted as a decimal number, for example 1234 or 12345.67
Currency
QuantityFormatted as a decimal number.
RATINGGENERALThe user rated an item.
ValueThe value of the rating.
ADD_TO_CARTGENERALThe user added an item to the shopping cart.
Quantity
REMOVE_FROM_CARTGENERALThe user removed an item from the shopping cart.
Quantity
ADD_TO_FAVORITESGENERALThe user added the item to his favorites.
ListIdUse if the webshop supports multiple favorites lists.
REMOVE_FROM_FAVORITESGENERALThe user removed an item from his favorites.
ListIdUse if the webshop supports multiple favorites lists.
REC_CLICKGENERALThe user clicked on a recommended item.
PositionThe position of the clicked item in the recommendation list. The position of the first item is 1.
LOGINGENERALThe user logged in to the site. For this event the cookieId and also the userId must be specified.
ADD_TO_WISHLISTADDITIONALThe user added the item to his wishlist.
ListIdUse if the webshop supports multiple wishlists.
REMOVE_FROM_WISHLISTADDITIONALThe user removed an item from his wishlist.
ListIdUse if the webshop supports multiple wishlists.
HIDE_PRODUCTADDITIONALThe user hides a product that should not be recommended to him.
UNHIDE_PRODUCTADDITIONALThe user unhides a product that he marked as hidden previously.
PRODUCT_SEARCHADDITIONALA list of products was displayed to the user, for example by browsing a category or by free text search.
SearchStringThe search string, if the list is based on a free text search.
Filter.*If the listing is based on comparing an item namevalue to a filter value, you can provide the actual filter here. For example, if the user was browsing a specific category, name='Filter.CategoryId' and value='CategoryA' can be specified.
NEXT_RECOMMENDATIONADDITIONALThe user asked for more recommendation.
COMMENTADDITIONALThe user wrote a comment for the item.
NOT_INTERESTEDADDITIONALThe user would not like this item and similar items to be recommended to him, but he also does not want to give a negative rating for this item.
LETTER_READADDITIONALT The user read a letter which sent for him by the system (eg. a newsletter).
CLICK_OUTPRICE COMPARISONThe user jumps to an external webshop to buy the product. Used by price comparison sites.
LANCEAUCTIONThe user place a bid on the item.ValueThe value of the bid as a decimal number.
LETTER_SENDAUCTION, ADVERTISINGThe user sent a message to the advertiser.
ADD_ITEMAUCTION, ADVERTISINGThe user added an item to the site.
FREE_VIEWMEDIAThe user wached/listened an item for free.DurationHow long the user wached the item in seconds as a decimal number.
PAID_VIEWMEDIAThe user payed for waching/listening an item.
DurationHow long the user wached the item in seconds. A decimal number.
ValueHow much the user payed for waching the item. A decimal number.
SUBSCRIPTION_VIEWMEDIAThe user watched an item that was available for him by a subscription.
DurationHow long the user wached the item in seconds. A decimal number.
FOLLOW_USERSOCIALThe user follows an other user.OtherUserIdThe identifier of the followed user.
SHARESOCIALThe user share the item on a social site (eg. Facebook, Twitter,...).
REDEEMCOUPONThe user redeem the item (eg. a coupon).

Type

string

$itemId

$itemId : string

This is the identifier of the item which was viewed/bought/etc. by the user.

Set to null if it does no make sense, for example in case of a login event. Strings in the PHP client are always UTF-8 encoded.

Type

string

$recommendationId

$recommendationId : string

It should be an id of a previous recommendation, if this event is a consequence of a recommendation.

Strings in the PHP client are always UTF-8 encoded.

Type

string

$time

$time : integer

The UNIX timestamp of the event, as returned by the standard time() PHP function.

Type

integer

$userId

$userId : string

This is the identifier of the user who generated the event.

If unknown set to null (for example if the user is not logged in yet). Strings in the PHP client are always UTF-8 encoded.

Type

string

$cookieId

$cookieId : string

A cookieId should be a permanent identifier for the end users computer, preserving its value across browser sessions.

This way not logged in users can be recognized, if they have logged in previously from the same computer. The cookieId should be always specified. Strings in the PHP client are always UTF-8 encoded.

Type

string

$nameValues

$nameValues : array<mixed,\GravityNameValue>

The NameValues for the event. The possible list of namevalues depends on the event type.

NameValues provide additional description of the event. There can multiple NameValues with the same name. The order of NameValues will not be preserved, but the order of the values for the same name will be preserved.

Type

array<mixed,\GravityNameValue>

Methods

__construct()

__construct()