Skip to content

Instantly share code, notes, and snippets.

@wbashir
Created October 7, 2013 19:31
Show Gist options
  • Select an option

  • Save wbashir/6873584 to your computer and use it in GitHub Desktop.

Select an option

Save wbashir/6873584 to your computer and use it in GitHub Desktop.
function setPresence (whereAt) {
Meteor.Presence.state = function() {
return {
online : true,
whereAt: whereAt
}
}
}
function trackPageview (path) {
var settings = Meteor.settings
, UA = 'UA-XXXXXXX-Y';
window._gaq = window._gaq || [];
window._gaq.push(['_setAccount', UA]);
window._gaq.push(['_trackPageview', path]);
}
Deps.autorun(function () {
var location = IronLocation.get();
if (! location) {
return;
}
trackPageview(location.pathname);
setPresence(location.pathname);
Deps.afterFlush(function () {
$(window).scrollTop(0);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment