How do I add custom dimensions to Google Analytics with React Router? -
my current analytics setup looks this:
this.context.router.listen(location => { analytics.page(location.pathname, { title: document.title, url: `${config.host_url}${this.context.router.createhref(location)}`, path: this.context.router.createhref(location), referrer: document.referrer, state: location.state, }); });
the amount of data in location
object pretty minimal. question is, how information item loaded in componentdidmount
block page tracking?
in particular instance, trying add information artwork user looking @ google analytics custom dimension. link below shows how added.
https://support.google.com/analytics/answer/2709828?hl=en#example-hit
i'm using react-router v2
from information given, i'd best bet on pages want add more data put condition in listener not log if loading page. in componentdidmount have data call analytics page.
basically override pages need more data.
Comments
Post a Comment