Start Exploring Keyword Ideas
Use Serpstat to find the best keywords for your website
How To Track 404 Errors With Google Analytics And Tag Manager
The purpose of the error page is to report that something has gone wrong and to offer the visitor a transition to relevant links — the main page or a similar remote one.
The main reasons when the web page gives the server response code "404 not found":
- the page removed by webmaster;
- the page moved to a new address;
- the page moved to another section;
- the link was broken;
- wrong redirection;
- the server worked incorrectly;
- human error (misprint in the URL), and more.
You can check the presence of 404 errors with the help of Serpstat Site Audit tool. Just set up the audit and go to All issues report when the process is finished:
Google Analytics: where the customer receives an error notification
Similar names differ on different websites, check what you have set by hovering the cursor over the name of the error page in the browser.
In this example, we checked the visits of 404 pages in a day; you will need to look at a wider range. Adjust the appropriate range in the upper right corner of the graph and study the resulting table.
The screenshot shows how the link is displayed in the table. It is active, so check in person, if the page remains inaccessible.
How to add an event to Google Analytics and Google Tag Manager
Perform the following steps:
- name: "JavaScript - Page Title";
- type: "JavaScript variable";
- global variable: "document.title".
Let's move on to creating a trigger. When adding a new trigger, you need to clarify its settings. Set up tracking of 404 errors called "404 Trigger Title" or another name that you can understand.
Select event type Google Analytics "View Page". Configure activation on some pages that should respond with 404 code:
Create a special tag called "404 - Event Tag". Fill out the proposed configuration to this tag.
Parameters that you need to set:
- type - "Universal Analytics";
- track type - "Event";
- category - "Error 404";
- action - "{{Page URL}}";
- write a tracking ID, which you can add as a constant variable to the Google Analytics tool, this will simplify your work in the future;
- Finally, associate the prepared "Page Viewer" trigger with the analytics type from the first item.
Save and test your work with a preview.
All variables, trigger and tag work directly to track events in Google Analytics.
404: Event Reports
Setting up Google Analytics events with GTM makes it easy to track 404 errors and fix them quickly.
Conclusion
Two free tools - Google Analytics and Google Tag Manager - help to track when a visitor came to the page and something went wrong. GA shows all failed sessions due to 404. All that is required of you is to sort by page name with the appropriate heading the "Page not found".
If you do not want to remember every time to check visits for errors, set up events which Google Tag Manager will send to Google Analytics.
Speed up your search marketing growth with Serpstat!
Keyword and backlink opportunities, competitors' online strategy, daily rankings and SEO-related issues.
A pack of tools for reducing your time on SEO tasks.
Discover More SEO Tools
Tools for Keywords
Keywords Research Tools – uncover untapped potential in your niche
Serpstat Features
SERP SEO Tool – the ultimate solution for website optimization
Keyword Difficulty Tool
Stay ahead of the competition and dominate your niche with our keywords difficulty tool
Check Page for SEO
On-page SEO checker – identify technical issues, optimize and drive more traffic to your website
Recommended posts
Cases, life hacks, researches, and useful articles
Don’t you have time to follow the news? No worries! Our editor will choose articles that will definitely help you with your work. Join our cozy community :)
By clicking the button, you agree to our privacy policy.