I am trying to use Google Analytics to find 404
pages using the following set of instructions:
To begin, go to Google Analytics and then navigate to Customization » Custom Reports. Now click on + New Custom Report.
Next, you’ll have to give a name to your report, like Broken Links Report. And then enter the following settings:
- Change the Type to Flat Table
- For Dimensions, add Landing Page and then Full Referrer
- For Metrics, search and add Entrances
- Then in the Filters, click add filter and select Page Title (make sure the first dropdown is set to Include and the next is set to Exact)
- Enter the exact title of your broken link, such as Page not found or 404.html
- Select All views associated with this account under Views
- Click Save when you’re done
However, the report is always empty (there is no data for this view) for whatever time range, though I know there were some 404
pages during this period.
Can you tell me what might be wrong with this method or how else I can accomplish this?
I also checked Using analytics to find what pages brought users to a 404 and it seems that the OP is using a similar method to find 404
pages.
Update
My site uses WP Rocket and I check the 404 page and find the following code:
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxxxx-xxx"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-xxxxx-xxx');
gtag('config', 'AW-xxxxxxxx');
</script>
Not sure if that will affect the Google Analysics report.