Clicky's tracking code can be highly customized to interact with your web site in just the way you want, and used to track additional data. All of the customizations are available via a JSON object that you create called clicky_custom. You can also log data manually, either from Javascript events (which includes support for "onclick goals"), or from internal scripts - a feature unique to Clicky.

Most of the options here are only applicable for premium accounts. For example, goals and custom data tracking are Pro-only features, while outbound/download/click tracking are available with any level of premium service (Upgrade here).


Jump to:

clicky_custom - JSON to customize data logged
utm_custom - log custom data via URL parameters (great for email marketing)
CSS tags - force our code to log clicks on items that it normally wouldn't


clicky_custom properties

Click on the name of any of these items to view the documentation for that specific item.

  visitor  

objectAttach custom data such as a username and an email address to a visitor session.

  visitor_keys_cookie  

arrayIf you set custom data for visitor sessions (see item above), 'username', 'name', and 'email' will get saved as cookies automatically so they will stick across visits. You can define an alternative set a keys with this option.

  href  

stringOverride the URL (path and query) being viewed. Only applies to page view actions.

  title  

stringOverride the HTML page title. Only applies to page view actions.

  goal  

mixedManually declare a goal as completed, and any revenue, if applicable.

  split  

objectUsed for split testing your goals

  timer  

integerChange the length of the pause timer for outbounds and downloads. Default is 500 (milliseconds).

  timeout  

integerChange the length of time (in minutes) that a visitor will ping our servers while on a single page. Default is 10 (minutes).

  iframe  

booleanIf the tracking code is installed in an iframe, we'll track the iframe, but in most cases your goal is to track the parent document instead. Specify so with this variable.

  cookies_disable  

booleanDisables all cookies set by our tracking code, except for those designed to reduce resource and bandwidth usage for non-paying and/or disabled sites (see here).

  sticky_data_disable  

booleanDisable saving certain types of data in cookies without disabling cookies entirely. Currently, dynamic (UTM) campaign variables, referrers, and custom data get saved as cookies so they stick across visits.

  outbound_disable  

booleanDisables the auto-tracking of outbound links and downloads.

  video_disable  

booleanDisables the auto-tracking of HTML5 video and audio.

  history_disable  

booleanDisables the auto-tracking of HTML5 history.pushState() navigation.

  queue_disable  

booleanThe tracking code uses a queueing method to make some tracking aspects more efficient and reliable. You can disable it with this option.

  ping_disable  

booleanOur tracking code pings our servers periodically while a visitor is on a single page of your site, which helps us give a more accurate time-on-site value for each visitor. Use this option to disable the pinging. (We really have no idea why anyone in their right mind would want to do this, but it was requested, so here you are!)

  pageview_disable  

booleanDisables tracking a page view initial loading of the tracking code. Data will only be logged by manual calls to clicky.pageview(), clicky.log() or clicky.goal(). Useful in scenarios where you only want data logged for certain events and actions.

  osa_disable  

booleanIf there are any pages on your web site that you never want the on-site analytics widget to appear, set this parameter.

  heatmap_disable  

booleanHeatmap data will only be tracked if you have enabled it. However if for some reason there are certain pages you don't want this data tracked for, set this variable on those pages.

  heatmap_objects  

mixedIf your site's JavaScript disables event propagation on some elements (e.g. JS menus), use this variable to force Clicky to explicitly listen for clicks on those items.

  outbound_pattern  

mixedIf some or all of your site's outbounds links use redirects instead of direct links, you'll need to use this variable to specify additional URL pattern(s) that our tracking code should look for to track clicks on these links.

  cookie_domain  

stringBy default, the domain scope for our tracking cookie will be set to ".yoursite.com". The "." at the beginning means it will apply to every sub-domain. You can change the domain scope with this variable.

You can declare clicky_custom and the properties you want to use with a single command, or you can just define clicky_custom as a generic JSON object and add the properties one at a time later. Which one you choose is up to you, although we do recommend the "one at a time" method. This is so that your logic for outputting this data doesn't have to be all in the same place, and so that you don't accidentally overwrite the entire object with a later call to it.

Each of these methods are shown in the examples below, and each accomplish the same end result: add a few session variables, change the pause timer to 200, and customize the page URL and title.

Example: One at a time

<script type="text/javascript">
  var clicky_custom = {};
  clicky_custom.href = '/some/page?some=query';
  clicky_custom.title = 'Some page';
  clicky_custom.session = {
    username: 'bobjones',
    email: 'bob@jones.com'
  };
  clicky_custom.timer = 200;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/123.js" type="text/javascript"></script>


Example: All at once

<script type="text/javascript">
  var clicky_custom = {
    href: '/some/page?some=query',
    title: 'Some page',
    session: {
      username: 'bobjones',
      email: 'bob@jones.com'
    },
    timer: 200
  };
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/123.js" type="text/javascript"></script>


IMPORTANT!
The clicky_custom object should only be declared ONE time within your entire HTML page. The examples below each declare it seperately, as they are standalone examples. If you are going to use more than one property, remember to only declare the clicky_custom object the FIRST time!

Also, clicky_custom and all of the properties you want to use must be defined before the tracking code is included on your web page. Otherwise, the tracking code will not see it!


clicky_custom.visitor

(Note: This used to be called clicky_custom.session. For backwards compatibility purposes, this old name will work indefinitely).

The visitor property allows you to add your own custom data to a visitor session, such as a username or email. This data will be stored in our database and accessible whenever you request the details of this session, whether that's through the web site itself, the API, third party widgets, or otherwise.

This is particularly useful if your web site has an account system that your users login to. When a user is logged in, you can attach their username and other information (email etc) to their visitor session with this property. When you view your visitors list, if you logged a "username" (lower case, one word) key, that value will be displayed in place of their IP address or organization/hostname, breathing life into your visitors and allowing you to quickly identify who is who. An unlimited number of key/value pairs can be declared, but we ask that you please keep it reasonable (five keys or so).

A few unique keys will be saved to a cookie automatically, so they will stick across visits, even if the visitor doesn't login on their next visit. You can override which keys get saved, as documented.

Custom data is attached at the visitor level, so it can be aggregated over multiple page views. In other words you can declare the 'username' property when they login, and something else later on when they complete some desired action, such as upgrading their account. We recommend you declare a 'username' key on every page view, if available, since it receives special treatment, particularly in Spy. Most visitors allow first party cookies so it won't matter for most of them since that is one of the special keys saved automatically in a cookie, but it's still the recommended strategy.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.visitor = {
    username: 'bobjones',
    email: 'bob@jones.com'
  };
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


How do you get the username or other data to output? Generally, you'll need access to the source code of your application to do that. Unfortunately, most hosted services, such as Typepad, don't let you do that. But there's still hope! When a visitor leaves a comment on most of these hosted blogs, the blog will save a few cookies that typically contain their name, email, and web site, so the next time the visitor leaves a comment they don't have to fill out that data again. You can extract that data with javascript, to attach their name to their session on Clicky!

The example below is for Typepad. WordPress cookie names are unique for each individual blog, as they are based on the domain name. To use with WordPress, leave a comment on your own blog and then look at the cookies for your domain. There should be one that starts with "comment_author_" and then a string of 32 random letters and numbers. This is the cookie name you would need to use for your blog.

<script type='text/javascript'>
function clicky_get_cookie( name ) {
  var ca = document.cookie.split(';');
  for( var i in ca ) {
    if( ca[i].indexOf( name+'=' ) != -1 ) return decodeURIComponent( ca[i].split('=')[1] );
  }
  return '';
}

var clicky_custom = clicky_custom || {};
clicky_custom.visitor = { username: clicky_get_cookie( 'typepadauthor' ) };
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


You can also declare custom visitor data in a special URL parameter, utm_custom. An example use of this would be links in email newsletters, so anyone clicking through can be easily identified.


If you set custom data for visitor sessions using the visitor option, the keys 'username', 'name', and 'email' will get saved as cookies automatically so they will stick across visits.

You can define an alternative set of keys with this option. Alternative means instead of, so if you want to keep any of the default ones such as 'username', you will need to declare those as well. In the example below, we are declaring a default key (username) and a custom one (campaign), so only those two keys will ever be saved in a cookie.

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.visitor_keys_cookie = ['username', 'campaign'];
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


IMPORTANT: Each key gets saved as its own cookie with the name _custom_data_[key], for example, _custom_data_username. However, only alphanumeric characters (a-z, 0-9) and a few others (periods, underscores, etc) are valid in the name of a cookie, so if you use anything else for a custom data key, it probably won't get saved as a cookie.

Custom data cookies are set to essentially never expire. Referrer and campaign cookies expire after 90 days.

Also, a note about order of priority when our code sends custom data to our servers. First, we check for any data saved in cookies. Next, we check for any data declared in clicky_custom.visitor. If there are any conflicts with the cookie values, the cookies are updated with the new values and the new values are sent to us instead (on a per-key basis). Last, we check for utm_custom parameters in the URL. These are ultimate authority and will override any previously discovered values, including updating any conflicting cookie values.

Last, if you have set the cookies_disable or sticky_data_disable options, for obvious reasons no custom values will get saved as cookies.


clicky_custom.href

If your URLs are complex with many variables, but you only want to track certain variables to make your content more consistent on Clicky, override it with this property. Note that this only applies for page view action types. Downloads, outbound links, and events are tracked differently.

Let's pretend the page being viewed is /items.php?id=123&name=Some+item&cart_id=456&campaign=Google. The only thing you probably care about is the ID. You would do this to override it:

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.href = '/items.php?id=123';
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.title

Use this property to override the HTML page title attribute. Note that this only applies for page view action types. Downloads, outbound links, and events are tracked differently.

Each unique URL for your web site can only have one unique title associated with it, which means any unique page URL that has already been tracked on Clicky cannot be changed with this property. However, there are plans to create an interface for you to change the titles of pages that are already stored in the database. This will be available in the future.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.title = 'Some page';
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.goal

You can manually declare when a goal has succeeded using this property. You need to declare goals this way if you want to track revenue for them. You may also wish to use this method if the needs of the goal are too complex for our funnel system.

This property is a JSON object, which has 2 of its own properties: ID, and revenue. ID is required, revenue is optional. Each goal has its own unique numeric ID in our database. The goal management page for any web site lists the ID for each goal next to the goal's name.

To track revenue, your code will need access to the value of the revenue, either through Javascript, cookies, or internally. You will need to talk to your shopping cart provider to discover how you can access and output this value.

Note that clicky_custom.goal is NOT the same as the clicky.goal() function. clicky_custom.goal is for declaring a goal within the HTML of your page, and must be declared before the standard tracking code. clicky.goal() is for declaring goals with Javascript events.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.goal = {
    id: "10",
    revenue: "49.95"
  };
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


As of February 2011, we also support "dynamic" goals, which do not need to be predefined in our system. Instead you simply declare the name of the goal in your Javascript and we'll automatically handle the rest. One big advantage with dynamic goals is that their overhead is negligible, so there are no limits on how many you can create. The downside is that you can't change their names, choose an icon for them, or use funnels.

To declare a dynamic goal, just use 'name' instead of 'id', and set whatever name you want to use! You can use revenue with dynamic goals as well, if desired.

Further documentation for dynamic goals is embedded with the goal setup page for any of your sites.

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.goal = {
    name: "New user",
    revenue: "49.95"
  };
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.split

You can split test any or all goals you have setup for your site with this option. Full documentation is embedded within the goal setup page for any of your sites, but an example of the code is shown below.

If you would like to use a graphical drag and drop interface to design your split tests, we have partnered with Visual Website Optimizer to help you with that. You will be able to use their interface to design and implement your split tests quite easily, and view the reports within Clicky.

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.split = {
    name: 'Landing page',
    version: 'New landing page'
  };
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.timer

Tracking downloads and outbound links adds a slight delay from the time a visitor clicks the link to when their browser reacts to that click. This delay is to ensure there is time for their browser to talk to our servers before it follows the link. This effect is undesirable, but also unavoidable if you want reliable tracking.

The default value is 500 milliseconds (half a second). You can change this to any value you want, but the shorter time you choose, the greater chance there is that we won't receive this data from the visitor (unless these links open in a new browser window).

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.timer = 250;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.timeout

Our tracking code automatically pings our servers when a visitor remains on a single page, so we can more accurately track the actual time they spend on your site. By default, after 10 minutes, this pinging will stop. Depending on the type of site you run, you may want to set this value higher or lower. You can set it to be anywhere from 5 minutes to 240 minutes (4 hours).

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.timeout = 120; // 120 minutes = 2 hours
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.iframe

If the tracking code is installed in an iframe, we'll track the iframe, but in most cases your goal is to track the parent document instead. Otherwise the page URLs and page titles you see in our reports will be for the iframe itself, and we won't be able to log referrers. So, if you want to track the parent document but can only put the code in an iframe or "widget" (e.g. with Apple's iWeb), set this variable, so that our code will grab the parent's URL, title, and referrer.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.iframe = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.cookies_disable

Our tracking code sets several different kinds of cookies. If you don't want cookies to be set on your visitors' computers, you can use this option. Details on all of the cookies we set and what they do are available here.

The two major side effects of disabling cookies are as follows:

1) Unique visitors will be determined solely based on IP address.
2) Heatmap logging will not work.

If either of those are important to you, do not set this option.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.cookies_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.sticky_data_disable

Set this option to disable saving certain types of data in cookies without disabling cookies entirely.
Currently, dynamic (UTM) campaign variables, referrers, and certain types of custom visitor data get saved as cookies so they stick across visits.

Custom visitor data cookies are set to essentially never expire. Referrer and campaign cookies expire after 90 days.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.sticky_data_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.outbound_disable

(Note: This used to be called clicky_custom.advanced_disable. For backwards compatibility purposes, this old name will work indefinitely).

When our tracking code executes on a web page, it automatically parses through all of the links on the page and determines which ones are outbound links and file downloads, and adds event listeners to them so we can track clicks on them.

If you want to disable this automatic tracking for any reason, you can do that with this property. When this property is enabled, you can still use CSS tagging to manually log specific links.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.outbound_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.video_disable

This option disables the automatic tracking of HTML5 video and audio files on your web site. For most sites it's desirable to track these, however for some video-heavy sites, this can add a significant number of actions that get logged, even so far as to require an upgrade to a higher plan.

If you want to disable this automated tracking, use this property.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.video_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.history_disable

If your site uses HTML5 history.pushState() navigation, Clicky automatically tracks these as normal page views.

Note that we do not track history.replaceState() automatically, as its purpose is quite different form pushState.

You may want to disable this, for example if you have already added custom code to log page views to Clicky within your core methods that call history.pushState(). In that case, use this option.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.history_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.queue_disable

The tracking code uses a queueing method to make some tracking aspects more efficient and reliable. For a small number of sites, however, it can cause some undesirable side effects. In this case, you can disable it with this option. We don't recommend doing this however unless you are positive that it's the reason for any issues you are having.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.queue_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.ping_disable

By default, our tracking code will periodically ping our tracking servers while a visitor is sitting on a single page, for up to 10 minutes. This helps us give you much more accurate time-on-site values for each visitor than most services offer, particularly for visitors who only have one page view. However, you can disable it if you wish, by using this option.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.ping_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.pageview_disable

When our tracking code is loaded on your web site, it will automatically log each page view as it happens. You can disable functionality with this property, if desired. This is useful in scenarios where you only want data logged for certain events and actions.

If this is enabled, data will only be logged when your site manually calls clicky.pageview(), clicky.log() or clicky.goal(). These are public javascript methods built into our tracking code.

If you use clicky.pageview(), don't pass it any parameters. It will automatically grab the current URL and the page title and send them our way.

Example:
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.pageview_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.osa_disable

If there are any pages on your web site that you never want the on-site analytics widget to appear, set this parameter.

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.osa_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.heatmap_disable

Heatmap data will only be tracked if you have enabled it. However, if there are certain pages you don't want this data tracked for, set this variable on those pages.

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.heatmap_disable = 1;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.heatmap_objects

Heatmaps are sometimes muddled by other JavaScript events on a page. When a JavaScript event invokes a function which stops its propagation, Clicky's code is not notified of the events and thus heatmap data may be slightly skewed. If you have code on your website which does this, you may tell Clicky explicitly to listen for such onClick events. If there's only one event you need Clicky's code to listen on, just specify it as a string. If there are multiple events you need Clicky's code to listen on, then create an array of strings. Items can be specified as "tags", ".classes", or "#ids".

Single event example:

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.heatmap_objects = '#my_menu';
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


Multiple events example:

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.heatmap_objects = [ '#my_menu', '#carousel', '.moving-ads' ] ;
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


clicky_custom.outbound_pattern

If your site uses redirects for outbound links, instead of links that point directly to their external source (this is popular with affiliate links, for example), then you'll need to use this variable to tell our tracking code additional patterns to look for when automatically tracking outbound links. This is because our tracking code has no way of knowing what will actually happen when the link is clicked on. Redirects typically look like internal links to our tracking code, so we don't track them by default.

So what do you use for the pattern? Some common redirect URLs we see are like this:

http://yoursite.com/go/othersite
http://yoursite.com/outbound/othersite
http://yoursite.com/aff/othersite

What you'll want to enter here is the the base part of these URLs, e.g. '/go/' or '/outbound/' or '/aff/'. You'll want to make sure whatever it is you use though is unique to your redirects, otherwise other links may start getting logged as well.

If there's only one pattern you need to match, which should be the case for most sites, just specify it as a string. If there are multiple patterns you need to match, then create an array of strings.

Single pattern example:

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.outbound_pattern = '/go/';
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


Multiple patterns example:

<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.outbound_pattern = ['/go/', '/aff/'];
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


This is for advanced users only. You should only consider using this option if you are intimately familiar with the way cookies work.

By default, the domain "scope" for our tracking cookie will be set to ".current-domain.com". The "." at the beginning means it will apply to every sub-domain of the current domain. We automatically account for "www", so a visitor to either "yoursite.com" or "www.yoursite.com" would both get a cookie for ".yoursite.com", which would then apply to every sub-domain of the root domain. This is generally desirable so we can track the same person across multiple sub-domains.

However, a new visitor to your site who initially arrives at "subdomain.yoursite.com" would get a cookie for ".subdomain.yoursite.com". In this case, if either "yoursite.com" or "www.yoursite.com" are directly accessible as well, this visitor would receive a new cookie if/when they visit your root domain after visiting the sub-domain. This would make them appear a new unique visitor, which is not the desired result. In this case, you would want to override the default cookie scope to ".yoursite.com" so that no matter what sub-domain the visitor arrived on or is currently on, they are seen as the same visitor.

Example: (supposing your site has multiple sub-domains)
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.cookie_domain = ".yoursite.com";
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>


There is also another scenario where you may wish to override the default behavior. If your site is only accessible via "yoursite.com" or "www.yoursite.com" (and the "wrong" one redirects to the "right" one automatically), and you only use sub-domains for hosting static content (Javascript, images, etc), then you'd want to set the cookie domain to just this public domain. Otherwise, the cookie we set will also be sent with every request to your static domain.

In most cases this is not a major concern, but if you have hundreds of thousands of daily page views, the excess bandwidth used by the cookie being sent with every request to your static domain may be a concern, or you might worry that it will conflict with a cookie name that you already use internally. (Our cookie name is fairly unique though - _jsuid - so this is unlikely). By setting the cookie to only the current domain, then our tracking cookie will only be sent for requests directly to the current domain.

IMPORTANT! The HTTP cookie specification states that the domain for a cookie must contain two periods. That means that if you redirect "www.yoursite.com" to "yoursite.com", you can not set the cookie domain to just "yoursite.com", because it only contains one period. If this applies to you, then your only choice is to stick with the default domain of ".yoursite.com" (with a period at the beginning) that our tracking code sets.

Example: (supposing your site is only directly accessible via "www.yoursite.com")
<script type="text/javascript">
  var clicky_custom = clicky_custom || {};
  clicky_custom.cookie_domain = "www.yoursite.com";
</script>

<!-- your hypothetical tracking code, which must go after clicky_custom -->
<script src="http://static.getclicky.com/js" type="text/javascript"></script>




utm_custom

TL;DR
If you are already familiar with logging custom visitor data, a quick summary: You can add utm_custom[key]=value variables to any URL (typically a landing page) to automatically attach custom data to a visitor session. For example, http://yoursite.com/page?utm_custom[username]=bobjones&utm_custom[email]=bob@jones.com would give you results like this.
utm_custom is a special URL parameter you can add to your pages to attach custom data to visitor sessions very easily, no programming required. The name "utm_custom" was chosen because this would typically be related to some kind of campaign (e.g. email blasts), and "UTM" variables are already commonly used for tracking online campaigns for Urchin, Google Analytics, and of course Clicky. (Also, because of our white label program, the name needed to be generic).

Since this is a "special" variable, it works differently than any other UTM campaign variables:
  • Clicky only processes UTM campaign variables for a visitor's landing page, but utm_custom can be declared at any time (because custom data can be attached to a visitor at any time).
  • Clicky groups campaigns by utm_campaign (which is used to 'name' the campaign), so we only process UTM campaign variables if utm_campaign is specifically declared. However, since utm_custom has a different although possibly related purpose, it can be declared by itself and it will still be logged.
  • utm_custom is attached at the visitor level, not the campaign level, so you will only see it in the visitor's report.

utm_custom is an associative array, which means it can take one or more pairs of keys and values. At least one pair is required, or it will be ignored. To set an array in a URL, you use this format: utm_custom[key]=value

username is a special custom key that will show up in your visitor's list report, as well as in Spy. So we recommend always declaring this variable if possible, even if it's not necessarily a "username". It could be their real name or their email address or whatever you want, but since it is treated in a special way, it is handy to use.

Let's pretend you have 100 subscribers to an email list. Your code could customize the links for each person receiving the email, so if any of them click it, you will know who is who when they arrive at your site. If one of your subscribers was Bob Jones, email bob@jones.com, his links could be formatted like this (we've also added in "normal" UTM campaign variables here, you can learn more about these on your site's campaign setup page):

http://yoursite.com/landing/page?utm_custom[username]=Bob+Jones&utm_custom[email]=bob@jones.com&utm_campaign=Email+blast&utm_content=Oct+20+2011

You would then see him like this in your visitor's list:




And you would see the following (highlighted) details when viewing the session:






Manually tagging a link as a download, outbound link or click


The following file extensions are automatically tagged as downloads by our tracking code:
7z, aac, avi, csv, doc, exe, flv, gif, gz, jpg, jpeg, mp3, mp4, mpeg, mpg, mov, msi, pdf, phps, png, ppt, rar, sit, tar, torrent, txt, wma, wmv, xls, xml, zip

Likewise, links that start with the protocols listed below are automatically tagged as outbound links, supposing they don't point to the same domain that the code is currently running on:
http, https, mailto, ftp, telnet, tel

You may wish to log downloads and outbounds on additional links that aren't supported by default by our code. Or, your site may have downloads and outbound links that link to an internal script first (typically to log the action in your own database) and then redirect the user to the actual file or link. These types of links do not get tagged automatically as downloads or outbounds, because they just look like internal links to the tracking code. There's no way for our code to know what will actually happen after the link is clicked.

Because of this, Clicky has a feature that lets you force the tracking code to tag a link as a download, outbound link, or click. Simply add one of the following classes to any link on your site, and our code will treat it as you have specified. The last class listed (clicky_log) is for the 'click' type. Otherwise, use clicky_log_download or clicky_log_outbound if you want it to be marked like that.

<a class="clicky_log_download" href="/download.php?file=sweet.mp3">Download!</a>
<a class="clicky_log_outbound" href="/redirect.php?url=http://google.com">Google!</a>
<a class="clicky_log" href="#ajax" onclick="MyAjaxFunction();">Click me!!</a>

These are logged similar to normal pages on your site with a URL and title. These are automatically extracted from the link by our tracking code. If there is no text for the link, we try to grab something meaningful instead. For example, if it is an image, we'll grab the URL of the image and use that for the title instead.

If you wish to customize the URL and/or title for these, you'll need to use our clicky.log() javascript function.


You can also exclude specific links from being automatically counted as downloads or outbound links, if desired. You just need to add the class "clicky_ignore" to the links you want ignored.

<a class="clicky_ignore" href="http://sweetsite.com/cool.mp3">Sweet download</a>
<a class="existing_class clicky_ignore" href="http://amazingsite.com">Amazing link</a>