Bitrix Site Manager

CStatEvent::GetList

CDBResult
CStatEvent::GetList(
 string &by = "s_id",
 string &order = "desc",
 array filter = array(),
 bool &is_filtered
)

The method GetList returns a list of events.

Parameters

Parameter Description
by Sorting field; possible values:
  • s_id - the event ID;
  • s_site_id - the site ID;
  • s_type_id - the event type ID;
  • s_event3 - the event auxiliary parameter event3;
  • s_date_enter - date and time the event was created ;
  • s_adv_id - the advertising campaign ID;
  • s_adv_back - flag: direct hit or return under the advertising campaign;
  • s_session_id - the session ID;
  • s_guest_id - the visitor ID;
  • s_hit_id - the hit ID;
  • s_url - page on which the event was generated;
  • s_referer_url - referring page;
  • s_redirect_url - address of the page to which the visitor was redirected after the event had been registered;
  • s_country_id - the visitor country ID;
  • s_money - amount of money.
order Sort order; the following values are possible:
  • asc - ascending;
  • desc - descending.
filter Array used to filter the resulting list. The following keys can be used in the array:
  • ID* - the event ID;
  • ID_EXACT_MATCH - if "N", entry in the ID is sufficient (loose match);
  • EVENT_ID* - the event type ID;
  • EVENT_ID_EXACT_MATCH - if "N", entry in the EVENT_ID is sufficient (loose match);
  • EVENT_NAME* - the event type name;
  • EVENT_NAME_EXACT_MATCH - if "Y", the EVENT_NAME must match exactly (strict match);
  • EVENT1* - the event1 event type identifier;
  • EVENT1_EXACT_MATCH - if "Y", the EVENT1 must match exactly (strict match);
  • EVENT2* - the event2 event type identifier;
  • EVENT2_EXACT_MATCH - if "Y", the EVENT2 must match exactly (strict match);
  • EVENT3* - the event auxiliary parameter event3;
  • EVENT3_EXACT_MATCH - if "Y", the EVENT3 must match exactly (strict match);
  • DATE - date and time when the event occurred (exact match);
  • DATE1 - the earliest date of the required events;
  • DATE2 - the latest date of the required events;
  • MONEY - event value (amount of money; exact match);
  • MONEY1 - minimum value of amount of money of the required events;
  • MONEY2 - maximum value of amount of money of the required events;
  • CURRENCY - three-character identifier of the amount currency;
  • SESSION_ID* - the session ID;
  • SESSION_ID_EXACT_MATCH - if "N", entry in the SESSION_ID is sufficient (loose match);
  • GUEST_ID* - the visitor ID;
  • GUEST_ID_EXACT_MATCH - if "N", entry in the GUEST_ID is sufficient (loose match);
  • ADV_ID* - the advertising campaign ID;
  • ADV_ID_EXACT_MATCH - if "N", entry in the ADV_ID is sufficient (loose match);
  • ADV_BACK - flag: direct hit (N) or return (Y) under an advertising campaign;
  • HIT_ID* - the hit ID;
  • HIT_ID_EXACT_MATCH - if "N", entry in the HIT_ID is sufficient (loose match);
  • COUNTRY_ID* - the visitor country ID;
  • COUNTRY_ID_EXACT_MATCH - if "N", entry in the COUNTRY_ID is sufficient (loose match);
  • COUNTRY* - name of the visitor country;
  • COUNTRY_EXACT_MATCH - if "Y", the COUNTRY must match exactly (strict match);
  • REFERER_URL* - the referring page;
  • REFERER_URL_EXACT_MATCH - if "Y", the REFERER_URL must match exactly (strict match);
  • REFERER_SITE_ID - the referring page site ID;
  • URL* - the page on which the event occurred;
  • URL_EXACT_MATCH - if "Y", the URL must match exactly (strict match);
  • SITE_ID - the ID of the site on which the event occurred;
  • REDIRECT_URL* - address of the page to which the visitor was redirected after the event had been registered;
  • REDIRECT_URL_EXACT_MATCH - if "Y", the REDIRECT_URL must match exactly (strict match).
* - complex logic allowed.
is_filtered If this flag contains "true" on return, the resulting list is filtered.

Structure of the returned record

Array
(
    [ID] => the event ID
    [EVENT3] => the event auxiliary parameter event3
    [TYPE_ID] => the event type ID
    [DATE_ENTER] => the time the event was created
    [EVENT1] => event1 event type identifier
    [EVENT2] => event2 event type identifier
    [NAME] => the event type name
    [EVENT] => event1 / event2, the event type name
               (if specified)
    [DESCRIPTION] => event type description
    
    [ADV_ID] => the adv. campaign ID
    [ADV_BACK] => flag: direct hit (N) or return (Y)
                        under an advertising campaign
    [COUNTRY_ID] => the visitor country ID
    [COUNTRY_NAME] => name of the visitor country
    [SESSION_ID] => the session ID
    [GUEST_ID] => the visitor ID
    [HIT_ID] => the hit ID

    [REFERER_URL] => the referring page
    [REFERER_SITE_ID] => the referring page site ID
    [URL] => the page on which the event occurred
    [SITE_ID] => the event site ID
    [REDIRECT_URL] => address of the redirect page
                      (after the event had been registered)

    [MONEY] => amount of money
    [CHARGEBACK] => Y - amount of money is negative;
                    N - amount of money is positive
    [CURRENCY] => three-character identifier of the amount currency
)

See Also

Example



<?
// select all existing events of user #1025
$arFilter = array(
    "GUEST_ID" => "1025"
    );

// obtain the list of records
$rs = CStatEvent::GetList(
    ($by = "s_id"), 
    ($order = "desc"), 
    $arFilter, 
    $is_filtered
    );

// print all records
while ($ar = $rs->Fetch())
{
    echo "<pre>"; print_r($ar); echo "</pre>";    
}
?>