Bitrix Site Manager

CPage::GetList

CDBResult
CPage::GetList(
 string counter_type = "",
 string &by = "s_last_date",
 string &order = "desc",
 array filter = array(),
 bool &is_filtered
)

The method GetList returns the list of visited pages (or catalogs), and the information on their attendance.

Parameters

Parameter Description
counter_type Type of counter. The following values apply:
  • ENTER_COUNTER - how many times the page was the entrance point;
  • EXIT_COUNTER - how many times the page was the exit point.
By default, the counter keeps total hits on a page (catalog), including both entrance and exit points.
by Sorting field; the following values are possible:
  • s_url - page (catalog);
  • s_counter - counter.
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:
  • DATE1 - the earliest date and time of the time period for which the information is to be returned;
  • DATE2 - the latest date and time of the time period;
  • DIR - specifies to return only pages or catalogs; the following values can be used:
    • Y - include catalogs only;
    • N - include pages only.
  • URL* - Full path to the page or catalog whose information is required;
  • URL_EXACT_MATCH - if "Y", the URL must match exactly (strict match);
  • URL_404 - whether the error 404 occurred on the required page (Y|N);

    This field cannot be used with catalogs.

  • ADV* - the ID of the advertising campaign (AC). This field allows to return only pages or catalogs that has been viewed by visitors under the specified AC, and obtain the attendance information only for these visitors;
  • ADV_EXACT_MATCH - if "N", entry in the ADV is sufficient (loose match);
  • ADV_DATA_TYPE - tells to retrieve information depending on the visit status:
    • B - return information on visitors returned under the specified AC;
    • P - return information on direct-hit visitors under the specified AC;
    • S - both returned and direct-hit visitors.
  • SITE_ID* - the site ID;
  • SITE_ID_EXACT_MATCH - if "N", entry in the SITE_ID is sufficient (loose match).
* - complex logic allowed.
is_filtered If this flag contains "true" on return, the resulting list is filtered.

Structure of the returned record

Array
(
    [URL] => page (section)
    [DIR] => [Y|N] flag: page (N) or catalog (Y)
    [SITE_ID] => the site ID
    [URL_404] => the error 404 flag
    [COUNTER] => hit count for the page (catalog) url
                 (if only counter_type != ENTER_COUNTER
                  and counter_type != EXIT_COUNTER)
    [ENTER_COUNTER] => how many times the url was the entry point
                       (if only
                       counter_type = ENTER_COUNTER)
    [EXIT_COUNTER] => how many times the url was the exit point
                      (if only
                      counter_type = EXIT_COUNTER)
)

See Also

Example



<?
// obtain information on the page
$arFilter = array(
    "URL" => "http://www.bitrixsoft.com/about/index.php",
    "URL_EXACT_MATCH" => "Y"
    );

// retrieve the list of records
$rs = CPage::GetList(
    "",
    ($by = "s_last_date"), 
    ($order = "desc"), 
    $arFilter, 
    $is_filtered
    );

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