Icarus User Guide - Web Analytics Plugins

This article covers web analytics plugins supported by Icarus.

The following web analytics plugins are provided by ppoffice/hexo-component-inferno. Please refer to it for a complete list of supported plugins and their configuration details.
All plugins mentioned below may be blocked by AD blockers. Use them with caution.

Baidu Statistics

Installation Guide

  1. Log into Baidu Statistics. Click the “Add new website” button on the “Admin > Site list” page and fill in the site information such as name and homepage URL. Click “OK” to complete site creation.

    Add Site - Baidu Analytics
  2. On the next page, find the ID behind hm.baidu.com/hm.js? and set it as the value of plugins > baidu_analytics > tracking_id in the theme configurations.

    Get Code - Baidu Analytics

    For example, the following Baidu Statistics code:

    Baidu Statistics code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <script>
    var _hmt = _hmt || [];
    (function() {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?3f06f2b732a5b1034c989f74e28d0eea";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
    })();
    </script>

    maps to the following theme configuration:

    _config.icarus.yml
    1
    2
    3
    plugins:
    baidu_analytics:
    tracking_id: 3f06f2b732a5b1034c989f74e28d0eea

Bing Webmaster Tools

Installation Guide

  1. Log into Bing - Webmaster Tools. Then, choose “Add your site manually” and enter the URL to your site. Click “Add” button to continue.

    Add Site - Bing Webmaster Tools
  2. In the “Add & verify site” panel, select “HTML Meta Tag” method. Copy value of the content attribute in the HTML meta tag to the plugins > bing_webmaster > tracking_id in the theme configurations.

    Verify Site - Bing Webmaster Tools
    _config.icarus.yml
    1
    2
    3
    plugins:
    bing_webmaster:
    tracking_id: ABCDEFABCDEFABCDEFABCDEFABCDEFABCDEF

BuSuanZi Web Counter

Installation Guide

  1. Set the plugins > busuanzi to true to enable BuSuanZi web counter. It displays the number of views of the current post on the header of each blog post, and the number of unique visitors of the whole site at the bottom of each page.

    _config.icarus.yml
    1
    2
    plugins:
    busuanzi: true

CNZZ Statistics (Umeng+)

CNZZ is now provided as part of Umeng+, and its pages may have changed since the following steps and screenshots were made.

Installation Guide

  1. Log into Umeng+. On the dashboard of Umeng+, click “Create new application” > “Web application”. Then, fill in your site information such as “website name”, “site domain name”, and “site homepage URL”. Click “Confirm adding the site” after finished.

    Add Site - CNZZ
  2. Find the HTML code in the “text style” row on the get installation code page. Copy the values of id and web_id to the plugins > cnzz > id and web_id in the theme configurations, respectively.

    Get Code - CNZZ

    For example, the following CNZZ installation code:

    CNZZ installation code
    1
    <script type="text/javascript" src="https://s9.cnzz.com/z_stat.php?id=123456789000&web_id=123456789000"></script>

    maps to the following theme configuration:

    _config.icarus.yml
    1
    2
    3
    4
    plugins:
    cnzz:
    id: 123456789000
    web_id: 123456789000

Google Analytics

Installation Guide

Google has replaced Universal Analytics with Google Analytics 4 (GA4). Old tracking IDs that start with UA- no longer collect data. Use the Measurement ID (G-XXXXXXXXXX) of a GA4 property instead. The Google Analytics pages change from time to time, so the names below may differ slightly from what you see.
  1. Log into Google Analytics and open the “Admin” page. Create a new property, and fill in the property name, reporting time zone, currency, and your business details.

  2. When asked to start collecting data, choose the “Web” platform. Enter the URL and a name for your site, and create the web data stream.

  3. Find the “Measurement ID”, e.g., G-XXXXXXXXXX, in the details of the web data stream. You can also find it later in the “Data streams” list of the property on the “Admin” page. Set it to the plugins > google_analytics > tracking_id in the theme configurations to enable the Google Analytics plugin.

    _config.icarus.yml
    1
    2
    3
    plugins:
    google_analytics:
    tracking_id: G-XXXXXXXXXX

    Icarus adds the Google tag (gtag.js) with this ID to the <head> of every page, so you do not need to copy the tag that Google Analytics shows you.

Hotjar

Installation Guide

  1. Log into Hotjar and click the ➕ (plus sign) > “Add new site” link on the top left of the page.

  2. Fill in the “WEBSITE”, “SITE TYPE”, and “SITE OWNER”, then click the “Add Site” button.

    New Site - Hotjar
  3. Find the newly created site on the “Sites & Organizations” page you have been redirected to. Click the “Tracking Code” button on the right.

    Site List - Hotjar
  4. Copy the value of “Site ID” (e.g., 1234567) from the popup dialog to plugins > hotjar > site_id in the theme configurations to enable the Hotjar plugin.

    Get Code - Hotjar
    _config.icarus.yml
    1
    2
    3
    plugins:
    hotjar:
    site_id: 1234567

Matomo

Installation Guide

  1. Set up Matomo, either on your own server or with Matomo Cloud, and add your site to it.

  2. Find the JavaScript tracking code of your site in Matomo. Copy the value of u (the URL of your Matomo server) and the value passed to setSiteId to plugins > matomo > url and plugins > matomo > site_id in the theme configurations, respectively. Both settings are required.

    For example, the following Matomo tracking code:

    Matomo tracking code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <script>
    var _paq = window._paq = window._paq || [];
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    (function() {
    var u="https://matomo.example.com/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '1']);
    ...
    })();
    </script>

    maps to the following theme configuration:

    _config.icarus.yml
    1
    2
    3
    4
    5
    6
    7
    8
    plugins:
    matomo:
    # URL of your Matomo server, such as https://matomo.example.com/ or https://example.matomo.cloud/
    url: https://matomo.example.com/
    # ID of your site in Matomo
    site_id: 1
    # Optional. Set to true to track visitors without cookies. Defaults to false.
    disable_cookies: false

    Icarus loads matomo.js from your Matomo server. When PJAX is enabled, every page that visitors switch to is tracked as a new page view.

Statcounter

Installation Guide

  1. Log into Statcounter. Click “Add New Project” button in the “Projects” page.

    Projects - Statcounter
  2. Fill in the website URL and project title in the “Add Project” page. Tweak rest of the project settings if you need to. Then, click the “Add Project” button.

    Add Project - Statcounter
  3. Click “Continue to Default Installation” in the “Platform Check Complete” page.

    Platform Check Complete - Statcounter
  4. Finally, in the “Insert the Code on Your Website” page, copy the value of sc_project and sc_security variable in the HTML snippet to plugins > statcounter > project and plugins > statcounter > security in the theme configurations, respectively.

    Insert Code - Statcounter

    For example, the following Statcounter code:

    Statcounter code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <script type="text/javascript">
    var sc_project=12345678;
    var sc_invisible=1;
    var sc_security="abcdef12";
    var sc_https=1;
    </script>
    <script type="text/javascript"
    src="https://www.statcounter.com/counter/counter.js"
    async></script>
    ...

    maps to the following theme configuration:

    _config.icarus.yml
    1
    2
    3
    4
    plugins:
    statcounter:
    project: 12345678
    security: abcdef12

Twitter (X) Conversion Tracking

Twitter has been renamed X. The following link and code were made for Twitter and may have changed since then.

Installation Guide

  1. Follow How to set up conversion tracking to enable universal website tag of Twitter conversion tracking.

  2. Find the init (Pixel ID) in your conversion tracking code. Copy its value to plugins > twitter_conversion_tracking > pixel_id in the theme configurations.

    For example, the following Twitter conversion tracking code:

    Twitter conversion tracking code
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <!-- Twitter universal website tag code -->
    <script>
    !function(e,n,u,a){e.twq||(a=e.twq=function(){a.exe?a.exe.apply(a,arguments):
    a.queue.push(arguments);},a.version='1',a.queue=[],t=n.createElement(u),
    t.async=!0,t.src='//static.ads-twitter.com/uwt.js',s=n.getElementsByTagName(u)[0],
    s.parentNode.insertBefore(t,s))}(window,document,'script');
    // Insert Twitter Pixel ID and Standard Event data below
    twq('init','abcdef');
    twq('track','PageView');
    </script>
    <!-- End Twitter universal website tag code -->

    maps to the following theme configuration:

    _config.icarus.yml
    1
    2
    3
    plugins:
    twitter_conversion_tracking:
    pixel_id: abcdef

Umami

Installation Guide

  1. Add your site to Umami, either on Umami Cloud or on your own Umami server.

  2. Find the tracking code of your site in Umami. Copy the value of data-website-id to plugins > umami > website_id in the theme configurations. This setting is required. If you host Umami yourself, also copy the src of the script to plugins > umami > script_url.

    For example, the following Umami tracking code:

    Umami tracking code
    1
    <script defer src="https://umami.example.com/script.js" data-website-id="12345678-abcd-1234-abcd-123456789abc"></script>

    maps to the following theme configuration:

    _config.icarus.yml
    1
    2
    3
    4
    5
    6
    7
    8
    plugins:
    umami:
    # ID of your site in Umami
    website_id: 12345678-abcd-1234-abcd-123456789abc
    # Optional. URL of the Umami tracker script. Defaults to https://cloud.umami.is/script.js (Umami Cloud).
    script_url: https://umami.example.com/script.js
    # Optional. Only track the visits on these comma-separated domains, e.g., example.com,www.example.com
    domains:

    Umami also tracks the pages that visitors switch to with PJAX.

Waline Page View Counter

Installation Guide

Waline can count the views of each page as well as host comments. The counter uses the same Waline client as the comments. To count page views with Waline and display the number of views on the header of each post, set plugins > waline_pageview to true in the theme configurations. The counter then uses the server_url of the Waline comment plugin, which requires comment > type to be waline:

_config.icarus.yml
1
2
plugins:
waline_pageview: true

If you use another comment plugin, or want to count page views with a different Waline server, set the URL of your Waline server in plugins > waline_pageview > server_url instead:

_config.icarus.yml
1
2
3
plugins:
waline_pageview:
server_url: https://your-domain.vercel.app

Some notes on this plugin:

  • Do not also turn on the pageview setting of the Waline comment plugin, or each page view is counted twice. Icarus prints a warning when you generate your site with both of them on.
  • If neither server_url is set, the counter is not shown, and Icarus prints a warning when you generate your site.
  • Pages are counted by the path of their URLs, and the pages that visitors switch to with PJAX are counted too.
Something wrong with this article? Click here to submit your revision.
Author

PPOffice

Posted on

2025-09-20

Licensed under

CC BY-NC-SA 4.0

Loading contributions…