either wait for
window.clicky to be populated to log the current URL/page title, goals, or
Additionally, Clicky's use of global variables such as
clicky_custom to log custom data
works well with traditional web apps, but does not make much sense for single-page apps.
setVisitorData has been patched into the Clicky object to allow easier updating
of custom data.
npm install clicky-loader
In any module you want to log data to Clicky:
var clicky = require('clicky'); clicky.init(YOUR_SITE_ID); clicky.log(window.location.hash, 'Page Title', 'pageview'); clicky.goal('The user did something!');
init(siteId)- initialize clicky with your site ID
log(href, title, type)- the current href, page title, and action type ( one of
setVisitorData(object)- sets window.clicky_custom.visitor with the object you provide
isLoaded()- whether Clicky has loaded yet