Yoast’s Google Analytics for WordPress plugin rewrites links bug
So Yoast’s Google Analytics for WordPress plugin has a somewhat annoying “bug”, or oversight rather, where it rewrites relative link URLS to full URLs, including anchors. For example, <a href="#anchor"> becomes <a href="https://planetjon.ca/blah/#anchor">. There is more information about this on the wordpress forums.