29 Configuring Visitor Detection

This chapter contains the following sections:

29.1 Overview

Visitor tracking is done by the data capture application (sensor). Visitors can be tracked in the following ways:

  • Self-organized method, which supports tracking of new visitors

  • Sessionfingerprint method

  • Cookie method

    Note:

    By default, the Sessionfingerprint method is enabled on all sites.

29.2 Methods

Methods for tracking visitors are implemented by adding visitor tracking code to global.xml (and to the img tag, depending on the tracking method).

Note:

When changing the visitor tracking method, you must also update the global.xml configuration file for each sensor instance. The location of global.xml depends on the application server you are using.

When modifying parameters in the global.xml file(s), stop the Analytics Sensor web application, modify its global.xml file, then start the sensor to effect the change.

29.2.1 Self-Organized Visitor Tracking

The self-organized visitor tracking method uses the value of the cookieid parameter appended to the image request.

To track the visitor 

  1. Add the following parameters to the img tag:

    cookieid – the visitor ID

    newvisitor – determines whether the user has already visited the site

  2. If you need to change the name of the cookieid parameter (to visitorid for example), you must also do the following:

    1. Change the following line in global.xml as shown below:

      From:

      <alias name="cookieid" for="cookieid"/>
      

      To:

      <alias name="visitorid" for="cookieid"/>
      
    2. Pass the visitorid and newvisitor parameters to the img tag.

29.2.2 Sessionfingerprint Method

The Sessionfingerprint method identifies each visitor by a combination of the IP address, screen resolution, and agent string to assign sessions to visitors. You can enable Sessionfingerprint for all sites or a selected site. Sessionfingerprint is enabled for all sites by default when Analytics is first installed.

Note:

The Sessionfingerprint method does not support new visitor tracking.

To enable the sessionfingerprint method 

  • To enable visitor tracking on all sites, add the lines in bold type below to global.xml (nest them in the default <params> ... </params> tag, as shown):

    <params host="default">
    <param type="string" name="sessionIdGenerator"
        value="AppServerId"/>
    <param type="string" name="visitorIdGenerator"
        value="SessionfingerprintId"/>
    ...
    </params>
    
  • To enable visitor tracking on a selected site, add the lines in bold type below to global.xml (nest them in the <root> tag, as shown):

    <root>
    <params site="sitename">
    <param type="string" name="sessionIdGenerator"
        value="AppServerId"/>
    <param type="string" name="visitorIdGenerator"
        value="SessionfingerprintId"/>
    </params>
    
    <params host="default"> ...
    

Table 29-1 describes parameters for Sessionfingerprint visitor tracking.

Table 29-1 Parameters for Sessionfingerprint visitor tracking

Parameter Description
sessionIdGenerator

Specifies the ID generator that is used to identify sessions.

Caution: The default value is AppServerID. Do not modify this value. It is a reference to the object that generates the ID.

visitorIdGenerator

Specifies the ID generator that is used to identify a visitor to the site.

Required value for this method:

SessionfingerprintId

site

Name of the site that is passed via the img tag


29.2.3 Cookie Method

Using the cookie method, you can enable visitor tracking across all sites or within a selected site.

To enable the cookie method 

  • To enable visitor tracking on all sites, add the lines in bold type below to global.xml (nest them in the default <params> ... </params> tag, as shown):

    Note:

    When using the code below, replace the sample values with values of your own. For parameter definitions, see Section 29.2.3, "Parameters for cookie-based visitor tracking."

    <params host="default">
    <param type="string" name="visitorIdGenerator"
        value="CookieId"/>
    <param type="string" name="visitorIdCookieName" value="visid"/>
    <param type="string" name="visitorIdCookieMaxAge"
        value="31536000"/>
    <param type="string" name="visitorIdCookieDomain" value="firstsiteii"/>
    <param type="string" name="visitorIdCookiePath" value="/"/>
    <param type="string" name="visitorIdCookieSecure"
        value="false"/>
    ...
    </params>
    
  • To enable visitor tracking on a selected site, add the lines in bold type below to global.xml (nest them in the <root> tag, as shown):

    Note:

    When using the code below, replace the sample values with values of your own. For parameter definitions, see Section 29.2.3, "Parameters for cookie-based visitor tracking."

    <root>
    <params site="FirstSiteII">
        <param type="string" name="sessionIdGenerator" value="AppServerId"/>
        <param type="string" name="visitorIdGenerator" value="CookieId"/>
        <param type="string" name="visitorIdCookieName" value="visid"/>
        <param type="string" name="visitorIdCookieMaxAge" value="31536000"/>
        <param type="string" name="visitorIdCookieDomain" value=".firstsiteii.at"/>
        <param type="string" name="visitorIdCookiePath" value="/"/>
        <param type="string" name="visitorIdCookieSecure" value="false"/>
    </params>
    <params host="default">
    ...
    

Table 29-2 describes parameters for cookie-based visitor tracking.

Table 29-2 Parameters for cookie-based visitor tracking

Parameter Description
sessionIdGenerator

Specifies the ID generator that is used to identify sessions.

Caution: The default value is AppServerID. Do not modify this value. It is a reference to the object that generates the ID.

visitorIdGenerator

Specifies the ID generator that is used to identify a visitor to the site.

Required value for this method: CookieId

visitorIdCookieName

Name of the cookie set on the client side.

Example: visid

visitorIdCookieMaxAge

Age of the cookie in milliseconds. After this time, the cookie is invalid. (The value that you set is added to the current time.)

Example: 31536000

visitorIdCookieDomain

Domain on which the cookie should be set.

Example: firstsiteii

Note: If you wish to set visitorIdCookieDomain on your local host, do not use the localhost value. It is not accepted by most browsers. Instead, add the following type of entry to your hosts file:

Example:

127.0.0.1 firstsiteii.at

and change the analytics.datacaptureurl in futuretense_xcel.ini to:

http\://firstsiteii.at\:8081/sensor/statistic
visitorIdCookiePath

Sub-path on which the cookie should be set.

Example: "/"

visitorIdCookieSecure

Specifies that the cookie will be sent via a secure channel, such as an SSL connection. Do not change the default value (false).

site

Name of the site that is passed via the img tag.

Example: FirstSite II