Is there any possible way/ method to check that google analytics code is installed on all the pages of a website?

Please recommend me so, that I can fix that up.

1 Answer 1


You can write a crawler to go through your sitemap.xml (provided you have one, damn, you should have) and crawl through every link provided there and check for ga() being available as a function. A simple script would be:

if(typeof(ga) === 'function' || ga instanceof Function) {
   return true;
   // handles control to the next check

Alternatively, you can use this tool. I used it to crawl my website, and the result was positive, for over 1500 pages it has crawled in the time I wrote this answer.

  • It is good but, now working on the product pages or categorie pages of ecommerce.
    – P082
    Apr 7, 2017 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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