Bitrix Site Manager

CStatEvent::GetGID

string
CStatEvent::GetGID(
 mixed site_id = false
)

The method GetGID returns the special parameter used for creating events with functions CStatEvent::Add, CStatEvent::AddByEvents.

The special parameter is created using the following parameters of the current visitor:

Depending on the value of the parameter Encode additional parameter #EVENT_GID# for events of the Statistics module settings, the returned parameter may be either in the human-readable or encoded format.

Parameters

Parameter Description
site_id The site ID.

See Also

Example



<?
// the page to which the visitor will be redirected
// after the event is registered.
// e.g. payment system or registration service provider
$goto = "http://www.softkey.ru/catalog/basket.php?prodid=902&"
        "quantity=1&referer1=ritlabs_site&referer2=#EVENT_GID#";

// register event
$goto = eregi_replace("#EVENT_GID#",
                      urlencode(CStatEvent::GetGID()), 
                      $goto);
CStatEvent::AddCurrent("softkey", "out", "", "", "", $goto);

// redirect visitor
LocalRedirect($goto);
?>