comprehensive-rust
comprehensive-rust copied to clipboard
Track number of 404 hits
It would be nice to know how many times our 404 page is shown to people. That way we could try to find and update pages with broken links.
I think doing this would require setting the input-404 option to a page where we can add the necessary Google Analytics code.
Hi @kushayb!
Nice to meet you! I don't actually know how we would solve this — is it clear what I am trying to do? We use Google Analytics (GA) on the pages (add in index.hbs) and I would like to somehow monitor our broken links.
When people go to a page that doesn't exist, they're sent to a 404 page generated by mdbook (I think this works because of a GitHub default as well). I'm thinking that this page could somehow tell GA about the 404 error.
You would need to read up on the options here a bit so we can make a plan. As I said, I don't have a ready-made plan for this, so I would be relying on you for that :smile:
Is anyone working on this issue? This is my first time contributing and I would like to take up this issue.
Hi @ED-1-0, I don't think there has been any work done on this — or at least I haven't seen any.
Does my description above make sense? I hope you know GA to some extent? I'm not an expert in it myself, but I hope we can figure something out together.
I'm not familiar with GA but from what I understand, you want to track the number of times your 404 error page is shown. One of the options is to add input-404 setting in index.hbs file. Correct me if I am wrong.
One of the options is to add input-404 setting in index.hbs file. Correct me if I am wrong
That right, but we need to figure out what to put in the page you reference in that setting. That is where knowing Google Analytics comes into the picture.