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);});
Cada ejemplo de esta respuesta, abierto en el IDE. Editalo, ejecutalo, rompelo.
Example1.jsxjavascript4 líneasreferenciaEstos ejemplos son fragmentos de referencia — el IDE los abre para editar, sin vista previa.
¿Qué tan bien recordaste esto?