simoncor.net/themes/hugo-coder/docs/analytics/baidu.md
Simon Cornet 956e73d0e4
All checks were successful
Build and Publish / Build (push) Successful in 5s
Build and Publish / Deployment (push) Successful in 58s
[hugo] feat: update
2024-08-26 17:13:18 +02:00

602 B

Baidu

To use Baidu analytics in this theme, navigate to the setting page of your site at https://tongji.baidu.com/. You will get a piece of JS code provided as follows:

<script>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?<your_token_at_here>";
    var s = document.getElementsByTagName("script")[0]; 
    s.parentNode.insertBefore(hm, s);
})();
</script>

Then you can use it by filling your site toke your_token_at_here in the config file:

[params.baidu]
    token = "your_token_at_here"