0

I know I can track 404's using google analytic's, but our images are served from a CDN and we can't control the 404 page that is served from the CDN.

Is there a way that I can detect missing images and track that via google analytics?

1 Answer 1

3

I the end I went for this approach:

$("img").error(function () {
    var src = $(this).unbind("error").attr("src");
    pageTracker._trackPageview("/404-image?path=" + src + "&from=" + window.location.href);
});

Your Answer

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

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