Test Google Analytics on Localhost

前端 未结 2 792
滥情空心
滥情空心 2021-02-05 06:53

I need to test some custom firing events using Google Analytics. I\'d like to test in a local environment.

I\'ve set up my test site using apache with server name:

2条回答
  •  遥遥无期
    2021-02-05 07:20

    I do not recommend the above answer.

    I believe the best practice is to use the Analytics Debug js on your localhost. Debug prints in console EVERYTHING is doing, including firing events. That way you can check if your code is working or not without sending tracking info to Analytics on Localhost (which makes no sense).

    Find out more here :)

提交回复
热议问题