How to Use Screaming Frog to Check for Missing Google Analytics Tags

If pages on your website are missing the Google Analytics and Google Tag Manager tracking codes, you could lose valuable data that helps you improve your KPIs. Fortunately, you can use the SEO tool Screaming Frog to crawl every page of your website and validate that your analytics tags are placed on every page.

 

In this blog, I’ll explain how to check for missing code using Screaming Frog.

 

What is Screaming Frog?

Screaming Frog is a popular SEO spider tool that crawls webpages and finds a variety of onsite issues like:

  • Broken links

  • Redirects

  • Create XML sitemaps

  • Find duplicate content

  • And of course, missing JavaScript tags like Google Analytics and Google Tag Manager!

How to Use Screaming Frog to Check for Missing Analytics Tags

1.      Download Screaming Frog. The free version allows you to crawl up to 500 URLs, for a larger site, you’ll need to purchase a license.  

2.      Set up the Screaming Frog configuration (Configuration > Spider) to match your crawling needs. Here are the settings I commonly use: 

 
 

 3.      In the next section, I’ll share the custom search filters I use to find missing analytics tags in Screaming Frog. To set these up, navigate to Configuration > Custom > Search. There will be a column for each filter you add in the crawl results table:

 Custom Search Filters to Find Missing Analytics Code in Screaming Frog

 Google Tag Manager 

 HTML Does Not Contain: www.googletagmanager.com/ns.html?id=GTM-

 This filter finds pages missing the Google Tag Manager (GTM) tracking code. Only use if the site uses GTM or this filter will return all pages of the site. You’ll need to check the code ahead of time to see how the script is configured because every website’s implementation differs Here’s how the code looks on tayloreddata.com for example:

Google Analytics 4 (GA4)

HTML Does Not Contain: https://www.googletagmanager.com/gtag/js?id=G-

 This filter finds pages with missing Google Analytics 4 tracking code. Here's how the filter should look:

 If your website uses GTM (which you should be using!), the JavaScript code is rendered after the initial page load, so we’ll need to do a couple more steps.

Go back to the Spider Configuration, click on the Rendering tab, and select JavaScript. You can keep the AJAX timeout to the default 5 seconds.

 
 

 If you’re finding lots of false positives during your crawl though (where the filter is saying the GA tag isn’t there, but you can see it when you personally go to the page), increase AJAX timeout (secs) to 8. Then click OK.

 Here’s how to check that the GA4 script is on the page and you’re getting a false positive:

 1.      Filter the crawl for URLs that have the value “Does Not Contain” and copy one of the URLs where you’re sure the tag is there:

Then go to the URL in your browser, open the Elements tab in the console debugger (Shift + Ctrl + I), and search for the GA4 snippet we used for the Screaming Frog filter:

If you see it there, that means it is taking longer for this JS to render on the page and you’ll need to increase the AJAX timeout.

 You can also follow along with this video: How To Crawl JavaScript Websites - YouTube.

 

Now you’re ready to see the results of your crawl! To do this, click on the Custom Search tab. To focus on just the custom search values, simply click on the plus sign to the top right of the table, and select the Address and Occurrences options:

To save you some steps in the future, you can save your config settings for later use by navigating to File > Configuration > Save As, or to save the config settings as the default go to File > Configuration > Save Configuration as Default:

 
 

 

How to Look for Older Versions of Google Analytics         

 Here are the older versions of Google Analytics. Now that we’re about a month out from the UA sunset date you shouldn’t need to check for these tags, but I will document them just in case:

 Universal Analytics

Does Not Contain: ga(‘send', analytics\.js, or the property tracking ID, e.g., UA-xxxxxxxx-x

This only works if you’ve added the Universal Analytics tag directly to your source code. This won’t work if you’re using Google Tag Manager.

Classic

Does Not Contain: _gaq.push OR property ID UA-xxxxxxxx-x.

This will find pages that are using the Classic version of Google Analytics (which is two versions behind GA4).

💡Worried about data gaps? Let's make sure your website is tracking every interaction. Schedule a discovery call for a comprehensive tag audit.

Learn More

Here are some additional resources to learn more about running website audits using Screaming Frog:

 

Happy crawling! 🕷️

Previous
Previous

How to Track GA4 Ecommerce Events on Squarespace

Next
Next

My Favorite Productivity Tools to Get Work Done