7

On my blog (WordPress), I am using a caching plugin, and somehow it happens that on my popular posts, the page broke, which means the generated HTML never reached the ending HTML tag and broke in between.

The result was that the page display was wrong and Google Analytics code did not trigger.

How can I quickly detect all such broken pages, either through Google Analytics or some other tool?

1
  • What is the name of the caching plugin? Will be easier to solve the problem there rather than detecting malformed pages.
    – stevenw00
    Jul 28, 2013 at 15:38

1 Answer 1

3

The result was that the page display was wrong and Google Analytics code did not trigger.

If you know a page was not being returned, you can use Fetch as Google in Google Webmaster Tools to "see a page as Google sees it". This will give you an idea of what HTML code is being returned, and the HTTP status codes being returned by your server.

If the Google Analytics code is not being triggered, it either was not fully downloaded and executed, or your server returned error pages (e.g., 40x and 50x status codes instead of 200), which do not contain tracking code.

If the former is the case, then make sure your tracking code appears in the head section of your pages just before the closing </header> tag, as covered here: Google Anayltics - How to set up the web tracking code

If the later is the case (i.e., error status codes were returned), then you can track these occurrences by adding the tracking code to your server's error pages, as covered in these two sources:

Tracking Error 404 Pages and Broken Links in Google Analytics

How To Track 404 Errors in Google Analytics

Lastly, it's quite possible that the WordPress cache plugin is causing the issue, so uninstall/disable this plugin and retest your pages with Fetch as Google again to see if the problem goes away.

4
  • 1
    Better answer than mine...
    – JCL1178
    Jul 29, 2013 at 4:13
  • @JCL1178 Thanks, but yours was valid as well :-) Checking server error logs could be helpful too (if the WordPress hosting account provides them).
    – dan
    Jul 29, 2013 at 4:36
  • True but not in response to this question. The page breaking at the halfway point probably wouldn't show in the logs.
    – JCL1178
    Jul 29, 2013 at 4:40
  • Yea, there's likely a bug or memory issue with the cache plugin that may not be apparent (since bots can request pages more quickly). I've seen partially downloaded pages in situations like that, and logs wouldn't likely record those.
    – dan
    Jul 29, 2013 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.