Skip to content

Instantly share code, notes, and snippets.

@poteto
Last active August 29, 2015 14:26
Show Gist options
  • Save poteto/f0d53ad8a23752aea549 to your computer and use it in GitHub Desktop.
Save poteto/f0d53ad8a23752aea549 to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Route.extend({
metrics: inject.service(),
activate() {
this._trackPage();
},
_trackPage() {
run.scheduleOnce('afterRender', this, () => {
const page = document.location.href;
const title = this.routeName;
get(this, 'metrics').trackPage({ page, title });
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment