Bitrix Site Manager

CAdv::GetEventList

CDBResult
CAdv::GetEventList(
 int adv_id,
 string &by = "s_counter",
 string &order = "desc",
 array filter = array(),
 bool &is_filtered
)

The method GetEventList returns the list of the event types initialised by visitors who entered the site on a specific advertising campaign (AC).

Parameters

Parameter Description
adv_id The ID of the advertising campaign whose parameters are to be returned.
by Sorting field. Possible values:
  • s_id - the ID of the event type;
  • s_event1 - the event1 identifier of the event type;
  • s_event2 - the event2 identifier of the event type;
  • s_sort - the event type sort index;
  • s_name - the name of the event type;
  • s_counter - the number of events initialised by the direct hit visitors who entered the site on the adv_id advertising campaign;
  • s_counter_back - the number of events initialised by the returned visitors who entered the site on the adv_id advertising campaign;
  • s_def - default sorting (to be printed in the appropriate table).
order Sort order. Possible values:
  • asc - ascending;
  • desc - descending.
filter Array used to filter the resulting list. The following keys are possible in this array:
  • ID* - the ID of the event type;
  • ID_EXACT_MATCH - if set to "N", the ID can be an entry in the identifier string (loose match);
  • EVENT1* - the event1 identifier of the event type;
  • EVENT1_EXACT_MATCH - if set to "Y", the EVENT1 must match exactly;
  • EVENT2* - the event2 identifier of the event type;
  • EVENT2_EXACT_MATCH - if set to "Y", the EVENT2 must match exactly;
  • KEYWORDS* - name and description of the event type;
  • KEYWORDS_EXACT_MATCH - if set to "Y", the KEYWORDS must match exactly;
  • DATE1_PERIOD - starting date of the period;
  • DATE2_PERIOD - ending date of the period;
  • COUNTER_PERIOD_1 - if either DATE1_PERIOD or DATE2_PERIOD is set, this field may contain the minimum value of the range of quantity of events initialised by the direct hit visitors who entered the site on the adv_id advertising campaign;
  • COUNTER_PERIOD_2 - if either DATE1_PERIOD or DATE2_PERIOD is set, this field may contain the maximum value of the range of quantity of events initialised by the direct hit visitors who entered the site on the adv_id advertising campaign;
  • COUNTER_BACK_PERIOD_1 - if either DATE1_PERIOD or DATE2_PERIOD is set, this field may contain the minimum value of the range of quantity of events initialised by the returned visitors who entered the site on the adv_id advertising campaign;
  • COUNTER_BACK_PERIOD_2 - if either DATE1_PERIOD or DATE2_PERIOD is set, this field may contain the maximum value of the range of quantity of events initialised by the returned visitors who entered the site on the adv_id advertising campaign;
  • MONEY_PERIOD_1 - if either DATE1_PERIOD or DATE2_PERIOD is set, this field may contain the minimum value of the range of amount of money initialised by the direct hit visitors who entered the site on the adv_id advertising campaign;
  • MONEY_PERIOD_2 - if either DATE1_PERIOD or DATE2_PERIOD is set, this field may contain the maximum value of the range of amount of money initialised by the direct hit visitors who entered the site on the adv_id advertising campaign.
* - complex logic is allowed
is_filtered If this variable contains "true" on return, the resulting list is filtered.

Structure of the returned record

Array
(
    [ID] => the ID of the event type;
    [EVENT1] => the event1 identifier;
    [EVENT2] => the event2 identifier;
    [C_SORT] => sorting;
    [NAME] => name;
    [EVENT] => either the name or the ID of event1 / event2;
    [DESCRIPTION] => description;
    [COUNTER] => total number of events of this type occurred on direct hit under the AC;
    [COUNTER_BACK] => total number of events of this type occurred on return under the AC;
    [COUNTER_TODAY] => total number of events of this type occurred on direct hit under the AC for today;
    [COUNTER_YESTERDAY] => total number of events of this type occurred on direct hit under the AC for yesterday;
    [COUNTER_BEF_YESTERDAY] => total number of events of this type occurred on direct hit under the AC for the day before yesterday;
    [COUNTER_PERIOD] => total number of events of this type occurred on direct hit under the AC for the period;
    [COUNTER_BACK_TODAY] => total number of events of this type occurred on return under the AC for today;
    [COUNTER_BACK_YESTERDAY] => total number of events of this type occurred on return under the AC for yesterday;
    [COUNTER_BACK_BEF_YESTERDAY] => total number of events of this type occurred on return under the AC for the day before yesterday;
    [COUNTER_BACK_PERIOD] => total number of events of this type occurred on return under the AC for the period;
    [MONEY] => total value of events of this type occurred on direct hit under the AC;
    [MONEY_TODAY] => total value of events of this type occurred on direct hit under the AC for today;
    [MONEY_YESTERDAY] => total value of events of this type occurred on direct hit under the AC for yesterday;
    [MONEY_BEF_YESTERDAY] => total value of events of this type occurred on direct hit under the AC for the day before yesterday;
    [MONEY_PERIOD] => total value of events of this type occurred on direct hit under the AC for the period;
    [MONEY_BACK] => total value of events of this type occurred on return under the AC;
    [MONEY_BACK_TODAY] => total value of events of this type occurred on return under the AC for today;
    [MONEY_BACK_YESTERDAY] => total value of events of this type occurred on return under the AC for yesterday;
    [MONEY_BACK_BEF_YESTERDAY] => total value of events of this type occurred on return under the AC for the day before yesterday;
    [MONEY_BACK_PERIOD] => total value of events of this type occurred on return under the AC for the period.
)

See Also

Example



<?
$adv_id = 1;

// filter by event types "download / file1" and "download / file2"
// and obtain the additional information for December 2005
$arFilter = array(
    "EVENT1"       => "download",
    "EVENT2"       => "file1 | file2",
    "DATE1_PERIOD" => "01.12.2005",
    "DATE2_PERIOD" => "31.12.2005"
    );

// obtain the set of records
$rs = CAdv::GetEventList(
    $adv_id, 
    ($by="s_counter"), 
    ($order="desc"), 
    $arFilter, 
    $is_filtered
    );

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