As a marketer you want to provide our website visitors the best possible experience. But from time to time URLs get mistyped or changed resulting in a 404 error. Despite your best efforts to set up redirects and test for broken links, human errors occur. When a user visits a page that doesn’t exist they get a 404 error.
What is a 404 Error?
A 404 page not found error is a client side error that occurs when a page was not found. URLs getting removed, changed, or mistyped are often the cause.
No matter what the cause of the 404 error, they are bad news for your business. It means you had the opportunity to add value, and the user expected you to add value, but you let them down.
Reasons to Track 404 Page Not Found Errors:
If a url has pages linking to it, but now results in a 404, you are likely missing out on SEO juice. Take time to set up redirects for those pages.
If you are sending users to not existent pages you are not providing the best possible experience. 404 errors are annoying, unprofessional, and leave users feeling disappointed.
Lost Leads and Sales
Did your pricing page change from /plans.html to /pricing.html? Or maybe that awesome white paper got recategorized. If so, you are missing out on opportunities to gain leads and sales.
If you are not tracking and measuring url that 404 your cannot resolve the issue.
How to Setup 404 Page Not Found Errors with Google Analytics and Tag Manager
Setting up 404 event tracking in Google Analytics is straightforward, and only takes a few minutes when you use Google Tag Manager.
There are several ways to setup 404 event tracking. However, this method is straightforward and should work in most situations.
Step 1: Create a Variable that Captures the Page title
Step 2: Create a 404 Page Not Found Trigger
Next we need to create a trigger that will fire when the 404 page appears. To do this we first need to know what the page title for the 404 error page is. To do this type a non-existent url on your domain into your browser, and take not of what appears in the title bar. For my website that is ‘Page not found | Jordan McNamara.’ Within triggers create a new page view trigger that will fire when the page title for the 404 page is present.
Step 3: Create a 404 Tracking Event
Now we need to create an event that will be sent to Google Analytics. In the tag tab create a new event tag. Set the category to 404 Error. For the action we will want to to capture the url path so we know what page they attempted to visit. Next, set the label to referrer, this allow us to track which page has broken link on it. If they visited the url directly this will be blank. Lastly, have the event trigger when on a 404 error page.
Step 4: Enter Preview Mode and Test
The last step is verifying that everything it working. In Google Tag Manger enter preview mode, and visit a url that will result in a 404 error.
You should see that the page not found event fired.
When you click into the event you see the the page url and the referrer (if applicable).
Sit Back and Start Measuring
That its. Now you will be able to see when someone receives a 404 error on your site. Google Analytics will have the information you need to resolve the issue. Ultimately, this will provide your users with a better experience.