Advanced Data Collection

   

There are various other parameters that can be included in the JavaScript snippet.  Some of these parameters affect the way data is collected and some provide a method for collecting data in addition to the standard logfile data.  The following chart provides details on how these parameters are use.

 

i=[Dataset ID]

The parameter is the dataset id.  This is the only parameter that is absolutely required in the JavaScript snippet.   It can be set to any unique value that your choose, or the system can generate a 14 character string composed of digits and letters, both uppercase and lowercase. Also allows dots (.). If required, the website id and subdomain may be specified together as i:d like WEBSITEIDSTRING:subdomain

 

d=[domain]

Including the 'd' parameter causes the page a previously defined sub-domain of the website id.

 

s=[GET|POST|EXIT]

This optional field overrides the Method column on the NLF. The values are 'GET', 'POST', or 'EXIT'.

 

l=[url]

if specified, build headers to redirect to new location. Allows the JDC to be used as a redirector.

 

X=[param%3Dvalue%26param2%3Dvalue2]

The 'X' parameter is used to record virtually any type of data that a web page may have available.  The data gets stored in the request as a URL parameter, which can then be used to define a page, to create labels based on the URL parameters, or to generate reports in the Internal Search Report of the Site Overview in the ClickTracks application.  A typical use for this would be when you want to record data as a URL parameter but not pass that data along in the URL.  For example, if you want to record the status of a member (as it is stored in your database) when they login to your members' only site, you could use your scripting language (e.g. ASP, PHP, etc.) to lookup the member's status and then pass that information in the X parameter.  It won't appear in the actual URL--it will only be written into the JavaScript snippet. 

 

The JDC will take any data that is received in the X parameter and convert it into a query string that can be appended to the existing query string (or added as a new query string if the URL doesn't have one already).  You can capture multiple parameters with the X parameter, and each one will be recorded as an actual parameter. 

The 'X' parameter is passing parameters within a parameter value, so the parameter that get passed must be URL encoded.  So if you wanted to pass in the data 'Status=Premium Member&Logins=5', you would encode that to be 'Status%3DPremium%20Member%26Logins%3D5'.  If you don't do this, the JDC would be confused by any '=' or '&' within the X parameter, interpreting them as the end of the X parameter.  Specifically, the encoding for '=' is %3D and the encoding for '&' is %26.

 

Note: Beware of using this within campaign landing pages.  These parameters will not be included in the campaign destination URL definition provided by the search engine, but they will appear in the URL requested, so they will cause a mismatch on campaign pages.

 

U=[param%3Dvalue%26param2%3Dvalue2]

The 'U' parameter is basically the same as the 'X' parameter except U data is appended as a new column in the NLF file with XF: prepended.  This data will not be stored as URL parameters, though it will still be a set of name/value pairs.  Future features in ClickTracks will be able to take advantage of this data.

 

e=[SALE]

This is the parameter used to capture e-commerce order values.  Values are recorded in 12.34 format, with no currency symbol.  Though the 'e' parameter is used in the JavaScript snippet, it is converted at data collection time into the parameter name 'ct_ecommerce'.  That is the parameter to look for when setting up revenue tracking, in the ClickTracks application.

 

p=[http|https]

The 'p' parameter forces the JDC to use a specified protocol for the JavaScript snippet, regardless of the protocol of the containing document.  This may be useful in cases where the JavaScript needs to be submitted securely even though it is in a non-secure page. i.e. p=http or p=https

 

report=1

If this is set to 1 (i.e. true) , it causes the JavaScript to write lots of configuration and debug information to the calling browser. Usually called directly in the URL as http://server/cgi-bin/ctasp-server.cgi?report=1.  This is used strictly for diagnostics purposes.

 

C=1

The 'C' parameter adds all first-party cookies from the web page to NLF files in addition to those the JDC writes on its own. This should only be used if you are using third-party cookies for session/unique visitor/return visitor tracking.

 

<script language="javascript" type="text/javascript">

       document.write('<s'+'cript language="javascript" type="text/javascript" src="'+document.location.protocol+'//192.168.0.26/cgi-bin/ctasp-server.cgi?i=WEBSITEIDSTRING&C=1"></s'+'cript>');

 

c=[cookie=value]

The 'c' parameter also adds cookies from the web page to NLF files in addition to the session and visitor cookies that the JDC writes on its own. It can be used to capture a specific cookie by using the [cookie=value] form indicated above.  It can also capture all cookies set by the website by using 'document.cookie' in the JavaScript snippet as shown below:

 

<script language="javascript" type="text/javascript">

       document.write('<s'+'cript language="javascript" type="text/javascript" src="'+document.location.protocol+'//192.168.0.26/cgi-bin/ctasp-server.cgi?i=WEBSITEIDSTRING&c='+document.cookie+'"></s'+'cript>');

</script>

 

fp=1

This tells the JDC that first-party cookies will be used for session/ unique visitor/ return visitor tracking. Because fp=1 is getting this first-party cookie data, the C=1 (capital C) parameter cannot be used for collecting other first-party cookies set by the site. In order to collect first-party session cookies as well as the other cookies set by the site, we need to use the more complex JavaScript code utilizing the c (small c) parameter, as follows:

 

<script language=javascript type="text/javascript">

  document.write(

    '<'

    + 'script language=javascript type="text/javascript" src="'

    + document.location.protocol

    + '//stats.clicktracks.com/cgi-bin/ctasp-server.cgi?i=Vt52buiQDCNLpl&amp;fp=1&amp;c='

    + escape(document.cookie)

    + '"></'

    + 'script>'

  )

</script>