Google Tag Manager
By:
Raj Gurung
Published On :
January 28, 2024
A 404 error, often referred to as “Page Not Found,” is an HTTP response code indicating that the server could not locate the requested webpage. When a user attempts to access a URL that is either misspelled, no longer exists, or has been moved without proper redirection, the server responds with a 404 error.
Ensuring a seamless user experience on your website involves not only monitoring successful interactions but also identifying and addressing issues, such as 404 errors. Google Tag Manager (GTM) offers a convenient way to track and gain insights into these errors. Here’s a step-by-step guide on setting up 404 error tracking using GTM:
To set up this tracking, firstly you need to set a few things-
To get the title from any website you need to create a custom variable that will pull the title from the webpage
document.title
Firstly you need to create a tag that will send the data to Google Analytics 4
Now we need to create the trigger that fire only on the 404 header
`Document Title Contains Page not Found`
another option that you can try is to use the custom event trigger
Now you can test your tag by going to the Preview mode or going to Debug mode on your GA4
Do not forget to Publish your workspace and save all your tags and trigger
Let’s talk about your business goal and align the solution we provide with our digital marketing services.
FREE strategy call© Humming Web. All Rights Reserved