Google Analytics pageTracker is not defined?

前端 未结 4 480
遥遥无期
遥遥无期 2021-01-30 11:21

Little bit confused... I am trying to track mailto links being clicked, but constantly \'pageTracker is not defined\' is shown. I have the following code just before my end bod

4条回答
  •  青春惊慌失措
    2021-01-30 11:41

    We can also add:

    //mantain syntax between old and new asynch methods
    //http://code.google.com/apis/analytics/docs/tracking/asyncUsageGuide.html#Syntax
    function _pageTracker (type) {
        this.type = type;
        this._trackEvent = function(a,b,c) {
           _gaq.push(['_trackEvent', a, b, c]);
        };
    }
    
    var pageTracker = new _pageTracker();
    

    in new code to mantain old code in pages.

提交回复
热议问题