Tracking Google Analytics Page Views with AngularJS

前端 未结 21 978
北恋
北恋 2020-11-27 09:14

I\'m setting up a new app using AngularJS as the frontend. Everything on the client side is done with HTML5 pushstate and I\'d like to be able to track my page views in Goog

21条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 09:33

    The best way to do this is using Google Tag Manager to fire your Google Analytics tags based on history listeners. These are built in to the GTM interface and easily allow tracking on client side HTML5 interactions .

    Enable the built in History variables and create a trigger to fire an event based on history changes.

提交回复
热议问题