Added Matomo 404 page tracking.#475
Conversation
|
@codyro @jonathanspw @sboldyreva this seems sane to me, and seems to take all of the concerns from #467 into account. Do any of you see any problems here? The questions for me are around the automated deployments and the upgrades to vuepress, but I can't recall if we're even doing the second one regularly. |
I assigned #467 (the issue for this PR) to me to go over it once AlmaLinux/almalinux.org#619 is resolved as they're tangentially related. I'll aim to merge these both be EOW or sooner! |
Added Matomo 404 page tracking.
This is referring to this issue.
This is a huge PR, I tried to overwrite the 404 page with no success and nothing on the web worked.
It seems like when you create the
.vuepress/themedirectory Vuepress is treating it like a whole new theme which lead me to copy the entire theme to this directory. (Believe me I read through their whole docs this does not work 😞, or anything alike for that matter)Then I had to remove the script tag from the header tag in the
.vuepress/config.jsfile since this script tag is on every page (including the 404 page), I cannot simply "Add the Matomo tracking code in this custom 404 page...before the line" since it's in the header and cannot be changed from the404.vuelayout file.The solution I came up with is to use the needed JavaScript for pages in the
Layout.vuefile:And the needed JavaScript for 404s in the
404.vuefile:I proved that this works by generating the site and checking all of the js files (yes I went one by one) to see if they include the needed JavaScript:
404 page:
HTML tag:

JavaScript:

Any page:
HTML tag:

JavaScript:

List of changes:
.vuepress/themedirectory..vuepress/config.jsfile.Layout,vuefile.404.vuefile.I know these are huge changes, let me know what you guys think.
Maybe I missed something. 😄