While falling asleep about five minutes ago (looking at the longtail keywords for our blog) I was struck with a pretty awesome idea. If you remember Fixing Your 404’s with Google Analytics, I mentioned Matt Cutts solution, using Google Webmaster Tools to track where 404’s are coming from.

2728

To track your broken links in Google Analytics, you have 2 options. First, you can use a WordPress plugin like MonsterInsights. It automatically tags 404 pages for you, so you don’t have to make any additional configuration on your plugin. Second, you can manually create a custom report in Google Analytics to report 404 errors on your website.

I would like to track the path that leads to a 404 with Google Analytics. My Google Analytics JS: