Bitrix Site Manager

Adding events

In this topic

  • Loading from file
  • Event table
  • Automated registration of events
  • This form allows you to add events occurred outside the scope of your site. Examples of such events are order payments, order cancellation, etc.

    Loading from file

    The page also offers facilities to upload a CSV file containing a list of events. The uploaded file should have the following format:

    "[1]","[2]","[3]","[4]","[5]","[6]","[7]", where:

    1. ID of the event type
    2. Auxiliary parameter "event3"
    3. Date. The date should be specified in the date format of the current language.
    4. Additional parameter in the following format:
      [site code].[session ID].[visitor ID].[country ID].[advertising 
       campaign ID].[Y-return within advertising campaign; N-direct visit]. 
      The site code is defined in the settings of the Statistics module.
    5. Amount of money
    6. Three-character currency abbreviation (e.g. USD, RUR, EUR, etc.). The currency must have been defined in the Currency module. Otherwise, the value will not be converted to the base currency and the value will be assigned as is.
    7. Refund flag. If set to Y, then the value is kept back from the advertising campaign revenue. If set to N, then the value is added to the advertising campaign revenue.

    Please follow the below guidelines when creating a CSV file.

    Standard CSV file example

    16,"file1.exe","10.12.2002 12:30","BITRIX_SM.10.5.RU.6.Y","250","USD"
    16,"help_doc.chm","10.12.2002 12:30"
    16,"www","BITRIX_SM.11.4.US.8.N","233.45"
    16,"Bitrix: ""Site Manager""","BITRIX_SM.11.4.US.8.N","233.45","RUR","Y"

    Click the Load button to load the file in the form. The form is described below.

    Manual entry

    Another way to add events is to enter them manually.

    #Event type ID Event3 Date Additional parameter 
    (site_code.
    session.visitor.country.
    advertising_campaign.
    return_flag)
    Amount Currency Chargeback
    [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]
    1. Event number.
    2. Event type ID.
    3. Click this icon to select the type of event in a separate window.
    4. Auxiliary parameter event3 (for example, it may contain the order amount). 
    5. Date of the event. 
    6. Click this icon to display a calendar. 
    7. Additional parameter. 
    8. Sum of money under the event. 
    9. Currency (this column is only displayed if the base currency had been specified in the module settings. The base currency can be set if only the Currency module is installed.)
    10. If checked, the Amount is subtracted from the advertising campaign profit. Otherwise, the advertising campaign profit becomes increased by the value of Amount
    11. Click this icon to duplicate the current line.

    Automated registration of events

    When a visitor leaves the site, for example, for making an order, the link to the external pay system should contain a special template #EVENT_GID#. Later, the script file redirect.php automatically substitutes this template with the compound identifier:

    [site code].[session ID].[visitor ID].[country ID].[advertising 
     campaign ID].[Y-return within advertising campaign; N-direct visit].

    The below is an example of such a link:

    <a href="http://www.ritlabs.ru/redirect.php?event1=softkey_out&
     event2=thebat&event3=buy&
     goto=http://www.softkey.ru/catalog/basket.php?
     prodid=902&quantity=1&referer1=ritlabs_site&referer2=#EVENT_GID#">
    Êóïèòü
    </a>

    The above link is provided in the readable form for simplicity. The original link in the canonic format looks as follows:

    <a href="http://www.ritlabs.ru/redirect.php?event1=softkey_out&
     event2=thebat&event3=buy&
     goto=http%3A//www.softkey.ru/catalog/basket.php%3Fprodid%3D902%26quantity%3D1%26referer1%3Dritlabs_site%26referer2%3D%23EVENT_GID%23">
    Buy
    </a>

    The system HTML editor offers special features to insert such links.

    Most pay systems allow special parameters and return them in the order notification mail message. For example, the pay system www.softkey.ru accepts both referrer1 and referer2 parameters. As soon as you receive a message notifying you of the order, you should enroll this event in the statistics of your site.

    If you want the events to be enrolled automatically, you can do so by loading a PHP page. The full address of the page is constructed using the following formula.

    http://[your_site]/bitrix/admin/event_edit.php?
    
        USER_LOGIN=[login]&USER_PASSWORD=[password]&lang=[language]&
        Login=Y&TYPE=AUTH&AUTH_FORM=Y&
    
        ARR[]=[N]&LOAD_[N]=Y&EVENT_ID_[N]=[type_ID]&EVENT3_[N]=[EVENT3]&
        DATE_ENTER_[N]=[Date]&PARAM_[N]=[ÏÀÐÀÌÅÒÐ]]&MONEY_[N]=[amount]&
        CHARGEBACK_[N]=[refund_flag]&
    
        ARR[]=[N+1]]&LOAD_[N+1]=Y&EVENT_ID_[N+1]=[type_ID]&EVENT3_[N+1]=[EVENT3]&
        DATE_ENTER_[N+1]=[Date]&PARAM_[N+1]=[parameter]&MONEY_[N+1]=[amount]&
        CHARGEBACK_[N]=[refund_flag]&
    
    ...
    
        ARR[]=[M]&]&LOAD_[M]=Y&EVENT_ID_[M]=[type_ID]&EVENT3_[M]=[EVENT3]&
        DATE_ENTER_[M]=[Date]&PARAM_[M]=[parameter]&MONEY_[M]=[amount]&
        CHARGEBACK_[N]=[refund_flag]
    
    &check_unique=Y&save=Y
    Legend
    [your_site]
    Address of your site.
    [login]
    Login of a user with write access to the Statistics module.
    [password]
    Password of the above described user.
    [language]
    Abbreviation of the language used to format the event date (for example, en).
    [N], [N+1]
    Ordinal number of the event to add.
    [M]
    Number of events to add.
    [type_ID]
    Type ID of the event to add.
    [EVENT3]
    Auxiliary event parameter.
    [Date]
    Date of the event in the of the specified language ([language] field).
    [parameter]

    Parameter in the following format:
    [site_code].[session].[visitor].[country].[advertising_campaign].[on-return_flag].

    [amount]
    Amount of money under this event
    [refund_flag]
    Refund flag. If set to "Y", then the value is kept back from the advertising campaign revenue. If set to "N", then the value is added to the advertising campaign revenue. The default value is "N".
    check_unique
    Set this flag to Y to check the uniqueness of the added events. Otherwise, the uniqueness check is not performed.

    Sample address

    http://www.bitrix.ru/bitrix/admin/event_edit.php?
           USER_LOGIN=admin&USER_PASSWORD=123456&lang=ru&Login=Y&
           TYPE=AUTH&AUTH_FORM=Y&ARR[]=1&LOAD_1=Y&EVENT_ID_1=35&
           EVENT3_1=250&DATE_ENTER_1=10.01.2003&PARAM_1=BITRIX_SM.10345.676.US.3.Y&
           ARR[]=2&LOAD_2=Y&EVENT_ID_2=35&EVENT3_2=340&DATE_ENTER_2=11.01.2003&
           PARAM_2= BITRIX_SM.10400.700.RU.5.N&MONEY_2=970.35&check_unique=Y&save=Y

    Warning!
    The example above is given in human-readable form. For the page lo load correctly, you need to encode the url(for example, using the php function urlencode()).