Uncaught ReferenceError: _gaq is not defined (Google Analytics)

后端 未结 5 1311
名媛妹妹
名媛妹妹 2021-02-03 20:22

The following message appears when viewing a site page in the chrome debug log.

Uncaught ReferenceError: _gaq is not defined

The pag

5条回答
  •  梦毁少年i
    2021-02-03 21:16

    You can use the last version of analytics.js instead of ga.js

    ga.js is a legacy library. If you are starting a new implementation we recommend you use the latest version of this library, analytics.js. For exisiting implementations, learn how to migrate from ga.js to analytics.js.

    Here is an example:

    ga('send', {
      hitType: 'event',
      eventCategory: 'Video',
      eventAction: 'play',
      eventLabel: 'cats.mp4'
    });
    

提交回复
热议问题