Add a listener on the history object to record each page view:
history.listen(function (location) {window.ga("set", "page", location.pathname + location.search);window.ga("send", "pageview", location.pathname + location.search);});
Add a listener on the history object to record each page view:
history.listen(function (location) {window.ga("set", "page", location.pathname + location.search);window.ga("send", "pageview", location.pathname + location.search);});
Every sample from this answer, open in the IDE. Edit it, run it, break it.
Example1.jsxjavascript4 linesreferenceThese samples are reference snippets — the IDE opens them for editing, without a preview.
How well did you remember this?