Browse Source

Add ga listener

pull/74/head
afc163 9 years ago
parent
commit
541128ec96
  1. 11
      src/models/global.js

11
src/models/global.js

@ -62,4 +62,15 @@ export default {
};
},
},
subscriptions: {
setup({ history }) {
// Subscribe history(url) change, trigger `load` action if pathname is `/`
return history.listen(({ pathname, search }) => {
if (typeof window.ga !== 'undefined') {
window.ga('send', 'pageview', pathname + search);
}
});
},
},
};

Loading…
Cancel
Save