Google Search Console
Go to Google Search Console and add property.
![Enter blog URL under URL prefix](/2020/07/14/SEO-hexo-next/search_console_new_property.png)
Then verify ownership by HTML tag.
![Click HTML tag to see extended content](/2020/07/14/SEO-hexo-next/verify_ownership.png)
Copy the meta tag which contains verify code.
![Click copy](/2020/07/14/SEO-hexo-next/verify_ownership_HTML_tag.png)
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.
![Submit sitemap.xml to Google Search Console](/2020/07/14/SEO-hexo-next/submit_sitemap.png)
Check the status of siremap. You should see “Success”.
Google Analytics
Register on Google Analytics.
![Welcome to Google Analytics](/2020/07/14/SEO-hexo-next/welcome_google_analytics.png)
Enter account name (you can change it later).
![Account setup](/2020/07/14/SEO-hexo-next/google_analytics_account_setup.png)
Choose “Web”.
![What do you want to measure?](/2020/07/14/SEO-hexo-next/google_analytics_measure_website.png)
Enter “Website Web” and “Website URL”. Select “https://“.
![Property setup](/2020/07/14/SEO-hexo-next/google_analytics_property_setup.png)
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