How can I track github pages with Google analytics 4 - measurement ID? - github

I have a repo with README.md as main page. This repo uses mkdocs for generating static site. Also, added Google Analaytics measurement ID to the mkdocs.yml for tracking the traffic on the static site.
But my current requirement is to track the github pages on repo. I am aware of github insights feature where we can get the metrics. But would need more details for every github page.
Can someone help me with this please?

You already use Google Analytics to track your GitHub Pages website, but you want it to track your repo also, right?
In that case, it is not possible, because differently from your website, even if you do own the repo, you do not own it's page, GitHub does. And you probably added some HTML to track your website, but you can't change your repo's HTML. This was already answered here.
Now, if I misunderstood and what you want is to track your GitHub Pages website, then yes, you can.

Related

creating Blogs Posts in Github Repo and Next JS

I'd like to set up a separate Github repo where I can save blog post data and then call it into my Next.js website.
Is there is any possible way to do this? please help.
I tried looking at the solutions online but didn't found the one i am looking for.
You can do that with data like images and file resources by just adding them to the new GitHub repo and making it a github page. Then you can access them in your NextJs by using URL of the hosted page

Github only host for static website and not able to modify the website after it online?

Did Github hosting a website as static website?
Is that mean I do not able to make any changes to the website?
You must understand the difference between GitHub and GitHub Pages.
While using GitHub, you can store whatever you want (As long as it's legal). They are just files. You can delete, change and upload different files at any time.
While using GitHub Pages, the code stored on your GitHub repository will be available online. You cannot create a backend to your website in GitHub pages, they are "static". GitHub will just send the files you store in your repository to the people that visit the url, and the browser will display it as a website. You can change the files in your repository, and the website will be changed accordingly.

Comment section on Github Pages

I have made a website that I published as Github Page. Since Github Pages is not a server provider and can only store a static website, I cannot use a comment section server side.
Is there any other way of implementing comments / discussion feature on github pages? For example feedback form can be handled using Google Forms.
I do not believe this is possible anymore because as you said they only support static pages now. Yes, you can use google forums or something similar. You can also use GH discussions. You can find it on the top bar or go use a link. They are formated like this github.com/<user/orgenisation name>/<repository name>/discussions

I can't find my github account in google search

I can't find my github account and repositories in google search. I wrote to support and here is an answer.
Thank you for reaching out to GitHub Support. If you find that you are experiencing problems with your GitHub account not appearing in a Google search we would recommend reaching out to Google and submitting your Google profile page to be crawled. This can be done here.
https://search.google.com/search-console/welcome
But google search console need to verify ownership.
You need public repos, with commits in the master branch (which is indexed by Google, according to github.com/robots.txt)
And if that fail, especially regarding your GitHub account URL, try and submit it to Google: https://www.google.com/webmasters/tools/submit-url?pli=1

"There isn't a GitHub Pages site here."

Around 12 hours ago, I tried creating a personal blog using 'beautiful jekyll'. I followed the simplest 3-step method to get a basic blog running however, every time I enter my website link, I get
There isn't a GitHub Pages site here.
If you're trying to publish one, read the full documentation to learn
how to set up GitHub Pages for your repository, organization, or user
account.
There isn't anything that I did different from the tutorial. I want to know does github just takes long to publish the pages or is there some sorcery ?
As I commented:
github.com/nitinrabbit/yourboygorja.github.io would not work, since yourboygorja is not your GitHub username. nitinrabbit is.
So the repo should be called github.com/nitinrabbit/nitinrabbit.github.io
And some content needs to be pushed to it.
You may need to go to the settings>pages>Source>Main (or subfolders) to activate page root. You may find detailed explanations here.
https://hackernoon.com/use-custom-domain-with-github-pages-2-straightforward-steps-cf561eee244f