angular.js - angularjs Baidu statistics how to count
PHPz
PHPz 2017-05-15 17:02:59
0
3
695

It seems that statistics can only be counted up to the root directory

PHPz
PHPz

学习是最好的投资!

reply all(3)
为情所困

Mark and come back later


For details, please see https://tongji.baidu.com/open...
Baidu Statistics has a corresponding API interface.
Then I encapsulated it

var BaiduTongJi = {
    visitPage : function ()
    {
        _hmt.push(['_trackPageview', _path]);
    }
};

Then add a locationChangeStart event listener in your angular, similar to my code below.

        app.run(function($rootScope, $location){
            $rootScope.$on('$locationChangeStart', function ()
            {
                BaiduTongJi.visitPage($location.path());
            })
        });
洪涛

How to solve it?

淡淡烟草味

Looking for answers together. I know the main question, please let me know

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template