Google Search Console
Go to Google Search Console and add property.

Then verify ownership by HTML tag.

Copy the meta tag which contains verify code.

Paste the copied meta tag on the top of head.swig
.
Which is under <username>.github.io\themes\next\layout\_partials\head\
After generating and deployment, you will verify it successfully.
Submit Sitemap
Install Hexo plugin to generate sitemap.
1 | npm install hexo-generator-sitemap --save |
Then open _config.yml
under root\
, add the code beneath at the end:
1 | # Sitemap |
After generating and deployment, check if it generated sitemap.xml
successfully.
Then submit the sitemap to Google Search Console.

Check the status of siremap. You should see “Success”.
Google Analytics
Register on Google Analytics.

Enter account name (you can change it later).

Choose “Web”.

Enter “Website Web” and “Website URL”. Select “https://“.

Then you will get a unique tracking ID.
Put the ID in username.github.io\themes\next\_config.yml
:
1 | # Google Analytics |
See if Google Analytics get any dataflow.
Reference
https://support.google.com/webmasters/answer/9429907
https://github.com/hexojs/hexo-generator-sitemap
https://support.google.com/analytics/answer/1008015?hl=en