NexT will not send record to analytics service provider as long as the page’s host name does not match url
option set in Hexo config file. This will prevent local debugging from polluting analytics. Make sure you have configured url
correctly, otherwise these statistics tools may not work as expected.
Analytics Tools
Google Analytics
Create an account and log into Google Analytics. More detailed documentation
Edit NexT config file and fill
tracking_id
under sectiongoogle_analytics
with your Google track ID. Google track ID always starts withUA-
.NexT config file # Google Analytics
google_analytics:
tracking_id: UA-XXXXXXXX-X
only_pageview: falseWhen field
only_pageview
is set to true, NexT will only sendpageview
event to Google Analytics.
The benefit of using this instead ofonly_pageview: false
is reduce a external script on your site, which will give you better performance but no complete analytics function.
Baidu Analytics (China)
Login to Baidu Analytics and locate to site code getting page.
Copy the script ID after hm.js?
, like the following picture:
Edit NexT config file and change the value of baidu_analytics
to your script ID.
# Baidu Analytics ID |
Growingio Analytics
Official documentation: https://docs.growingio.com/v3/developer-manual/sdkintegrated/web-js-sdk/latest-jssdk
Edit NexT config file and change the value of growingio_analytics
to your project ID.
# Growingio Analytics |
Cloudflare Web Analytics
Edit NexT config file and change the value of cloudflare_analytics
to your project ID.
# Cloudflare Web Analytics |
Microsoft Clarity Analytics
Edit NexT config file and change the value of clarity_analytics
to your project ID.
# Microsoft Clarity Analytics |
Counting Tools
LeanCloud (China)
Adding article reading times counting to NexT theme. Documentation how to set the counter up and running safely aviable in hexo-leancloud-counter-security.
Install hexo-leancloud-counter-security
by executing the following command in site root dir:
$ npm install hexo-leancloud-counter-security |
Edit Hexo config file and add following content:
leancloud_counter_security: |
Edit NexT config file and fill options under leancloud_visitors
section.
# Show number of visitors to each article. |
Firebase
Firebase Analytics provides the functionality of visitor statistics.
Login to Firebase to get apiKey and projectId. The Web API Key gets generated once you go into the “Authentication” section for the first time.
Edit NexT config file and add or change firestore
section:
firestore: |
Busuanzi Counting (China)
Edit busuanzi_count
option in NexT config file.
When enable: true
, global setting is enabled. If total_visitors
, total_views
, post_views
are all false
, Busuanzi only counts but never shows.
When total_visitors: true
, it will show site UV in footer. You can also use font-awesome by setting total_visitors_icon
to the name of the icon.
busuanzi_count: |
When total_views: true
, it will show site UV in footer. You can also use font-awesome by setting total_views_icon
to the name of the icon.
busuanzi_count: |
When post_views: true
, it will show page PV in post meta. You can also use font-awesome by setting post_views_icon
to the name of the icon.
busuanzi_count: |