Uncaught ReferenceError: _gaq is not defined (Google Analytics)

后端 未结 5 1315
名媛妹妹
名媛妹妹 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条回答
  •  忘了有多久
    2021-02-03 21:17

    Had the same problem. You have to define the _gaq array. Just add this after your Google Analytics script in the header:

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-XXXXXX-X']);
    _gaq.push(['_trackPageview']);
    

提交回复
热议问题