· Simple statistics of personal web page visits (based on Baidu statistics)

Personal Home –> xiaosongshine. Github. IO /

Personal website github address: github.com/xiaosongshi…

Built a website, we can use Baidu statistics, can be very simple to see their own pages were visited times.

Use is also particularly simple, only need to register baidu statistics account, and then copy a code to your web page, very simple and convenient.

Practical demonstration photos:

 

1. Register baidu statistics webmaster version

Baidu search “Baidu statistics”, open the page, click on the upper right corner of the “register”.

 

We are for their own website statistics traffic, so click “register Baidu statistics webmaster version”.

 

Fill in the registration information as required.

 

2. Deploy it on your own web page

After registering the mailbox verification, you can log in baidu statistics, click “website center”, and then click “code management” directory under the “code”.

Note: after logging in, you will be asked to enter a personal website. If you already have a personal website, you can enter it. If not, you can write your own website first. For example, I typed yansongsong-cn, but actually my website is under review and has not been issued yet. Where do you actually deploy the code, where the statistics are available. The actual address of my home page is: http://118.25.101.147/

 

You will get the following code :(this is mine, you should use it according to your own)

1. Obtain the new statistical code

This code is suitable for PC and mobile pages at the same time, loading in the form of asynchronous loading, more accurate data, faster loading. Copy and paste this code into each web page you want to track.

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

2. Code installation instructions

  • 1. Please add the code before the tag on all pages of the site. (that is, between )
  • 2. It is recommended to install it in a similar header template page of header. HTM, so as to achieve the effect of one installation and the whole site.
  • 3. If you need to call the statistical analysis code in the JS file, please directly remove the beginning and end of the following code, , and put them in the JS file.

If the code is installed correctly, you can generally view the site analytics data after 20 minutes.

3. Code detection

After the code installation is complete, you can automatically or manually check the code installation on the Code Installation Check page.

Tip:

1. This code will not affect the display of your website page, please rest assured to use.

2. If you have technical questions, please consult your website administrator, hosting company, or Baidu promotion consultant.

Please Enjoy Yourself.

Welcome to visit myThe home pageTry it, if you think it helps, please give it a little encouragement.

Github address:Github.com/xiaosongshi…Welcome to visit