{"id":4512,"date":"2020-08-02T09:16:08","date_gmt":"2020-08-02T06:16:08","guid":{"rendered":"https:\/\/trackingchef.com\/?p=4512"},"modified":"2020-12-14T14:57:46","modified_gmt":"2020-12-14T11:57:46","slug":"tracking-404-pages-in-google-analytics","status":"publish","type":"post","link":"https:\/\/trackingchef.com\/google-analytics\/tracking-404-pages-in-google-analytics\/","title":{"rendered":"Tracking 404 pages in Google Analytics"},"content":{"rendered":"\n

One of the classic use cases for Google Analytics is identifying 404 pages on your site. With this report you can easily identify broken pages that need fixing, and also the internal pages or external links that led to them, which might need updating or a 301 redirect.<\/p>\n\n\n\n

404 is the response code of the server indicating that the URL requested couldn’t be found. The user will be sent to an error page indicating this error.<\/p><\/blockquote>\n\n\n\n

Creating a 404 report in Google Analytics<\/h2>\n\n\n\n

To create the report for 404 pages we’ll create a Saved Report with the presets required for reporting. This technique is quicker than creating a Custom Report.<\/p>\n\n\n\n

In Google Analytics, navigate to Behavior -> Site Content -> All Pages.<\/p>\n\n\n\n

\"\"<\/figure><\/div>\n\n\n\n

Add a Secondary Dimension of ‘Page Title’<\/p>\n\n\n\n

\"\"
Adding a Secondary Dimension of Page Title<\/figcaption><\/figure><\/div>\n\n\n\n

Next to the Search Box (above the report table), click on Advanced to open the advanced search dialogue.<\/p>\n\n\n\n

Change the selected dimension to Page Title and search for pages containing the 404 page’s title tag (see below). Save the search by clicking Apply.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

To easily access this report with these presets, you can now save the report by clicking the Save button just above the to graph (above the date picker). Give the saved report an easy to remember name, e.g. ‘404 Pages’.<\/p>\n\n\n\n

The report is now available under Customization -> Saved Reports.<\/p>\n\n\n\n

\"\"
Saved reports in Google Analytics<\/figcaption><\/figure>\n\n\n\n

Pro tip:<\/strong>
You can set this report to be sent by email on a set interval (e.g. weekly) so you’re always in control. Simply click on Share above the date picker.<\/p><\/blockquote>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Tracking 404 pages on WordPress<\/h3>\n\n\n\n

In most WordPress sites, the default page title for 404 pages is simply ‘Page not found | [site name]’, where site name is , well, your site’s name as defined in the site’s settings. <\/p>\n\n\n\n

You can simply search for ‘Page not found’ and Google Analytics should autocomplete the full name in the search box.<\/p>\n\n\n\n

Tracking 404 pages on Shopify<\/h3>\n\n\n\n

In most Shopify stores, the default page title for 404 pages is simply ‘404 Not Found – [site name]’, where site name is, well, your site’s name as defined in the site’s settings. <\/p>\n\n\n\n

You can simply search for ‘Not Found’ and Google Analytics should autocomplete the full name in the search box.<\/p>\n\n\n\n

Tracking 404 pages on other CMS<\/h3>\n\n\n\n

If you’re using a different CMS or you’re unsure what the title on your 404 pages is, simply navigate to a random URL on your site, causing a 404 response, and observe what is the page’s title.<\/p>\n\n\n\n

You can see the page’s title appear on the browser tab (hover over it to see the full text).<\/p>\n\n\n\n

\"\"<\/figure><\/div>\n\n\n\n

Tracking 404 pages on Single Page Applications<\/h2>\n\n\n\n

If you’re running a Single Page Application (SPA) site, I hope you’re already using my Generic Pageview event for SPA<\/a>. If you’re using this method you need to ask your developers to define a specific page title for 404 pages that you can pick up on in Google Analytics, e.g ‘Page not found’.<\/p>\n\n\n\n

 dataLayer.push({\n   'event' : 'pageview',\n   'pagePath' : '\/random-page',\n   'pageTitle' : 'Page not found'\n });    <\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

One of the classic use cases for Google Analytics is identifying 404 pages on your site. With this report you can easily identify broken pages that need fixing, and also the internal pages or external links that led to them, which might need updating or a 301 redirect. 404 is the response code of the […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-4512","post","type-post","status-publish","format-standard","hentry","category-google-analytics"],"_links":{"self":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/comments?post=4512"}],"version-history":[{"count":6,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4512\/revisions"}],"predecessor-version":[{"id":4801,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/posts\/4512\/revisions\/4801"}],"wp:attachment":[{"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/media?parent=4512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/categories?post=4512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trackingchef.com\/wp-json\/wp\/v2\/tags?post=4512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}