Baidu Statistics Plugin Configuration

Baidu Tongji Discourse Plugin

This is a Discourse plugin for integrating Baidu Tongji (Baidu Analytics) into your Discourse forum.

Features

  • Integrate Baidu Tongji tracking code
  • Support configuring Baidu Tongji Site ID through the admin interface
  • On/off control

Installation

  • Clone the code to the plugins directory /var/www/discourse/plugins

    docker exec -it discourse-web-1 bash
    cd /var/www/discourse/plugins
    git clone https://github.com/xuxiaowei-com-cn/discourse-baidu-tongji.git
    
  • Restart the container

    docker restart discourse-web-1
    



Notes

  • Abnormalities may occur if software such as AdGuard is installed in the browser.
    1. Test with an incognito browser
    2. Add the domain to the whitelist
    3. Temporarily disable AdGuard and try again

Thanks for your contribution!

This doesn’t need to be a plugin. Since you’re adding code only to the front end, a theme component is easier and preferred. You can just stick that javascript in an initializer.

Also, this isn’t how to install a plugin. It’s unclear if you’re using something other than a standard install or you just haven’t looked at the documentation, but the template that you were provided with included a place to put the github URL as well as a link to how to install plugins. It might be hard to make sense of in all of the formatting for the table.

1 Like