How to Stop Google Analytics
Thinking about removing Google Analytics from your website? Whether you're switching to a new analytics tool, streamlining your site for better performance, or focusing on user privacy, the process is simpler than you might think. This guide will walk you through exactly how to locate and remove the Google Analytics tracking code, step-by-step, no matter what kind of website you have.
Why Stop Using Google Analytics?
Removing Google Analytics is a common move for many website owners. While it's an incredibly powerful and free tool, there are several practical reasons why you might decide it's time to part ways.
You're Switching to a Different Analytics Platform
The analytics landscape is full of great alternatives. Some businesses switch to privacy-focused tools like Plausible or Fathom that don't use cookies and offer simpler dashboards. Others might consolidate their tools, opting for an all-in-one marketing platform that has its own built-in analytics, reducing the need for separate tracking scripts.
Growing Privacy Concerns (GDPR & CCPA)
User privacy is more important than ever. Regulations like the General Data Protection Regulation (GDPR) in Europe and the California Consumer Privacy Act (CCPA) require clear user consent for tracking cookies. Managing cookie consent banners and ensuring full compliance with Google Analytics can be a legal and technical headache. For some businesses, removing GA is the easiest way to respect user privacy and avoid potential compliance issues.
Improving Website Performance
Every script you add to your website has a small but measurable impact on page load speed. The Google Analytics JavaScript file is lightweight, but it’s still an external request your visitors' browsers have to make. If you’re laser-focused on optimizing your site's performance and Core Web Vitals, removing any non-essential scripts - including analytics you no longer use - can contribute to a faster user experience.
Simplifying Your Tech Stack
Sometimes, less is more. Having too many third-party scripts and tools can make website maintenance a chore. If you find you aren't actually using the data from Google Analytics or the insights aren't actionable for your business, removing the code is a simple way to clean up your site and reduce complexity.
First, Find the Google Analytics Tracking Code
Before you can remove the code, you need to know where it is. It's usually a small block of JavaScript added to your site's header. Here’s how you can check if and where it’s running.
Method 1: Check Your Website's Page Source
This is the most direct way to see every script loading on your page. It requires no special tools, just your web browser.
- Open your website in a browser like Chrome or Firefox.
- Right-click anywhere on the page and select "View Page Source" (the wording may vary slightly).
- A new tab will open showing your site’s HTML code.
- Press Ctrl + F (on Windows) or Cmd + F (on Mac) to open the search box.
- Search for
<script src="https://www.googletagmanager.com/gtag/js> or<script src="https://www.google-analytics.com/analytics.js>. These are the filenames for Google Analytics 4 and the older Universal Analytics, respectively.
The code snippet will look something like this for GA4:
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [],
function gtag(){dataLayer.push(arguments),}
gtag('js', new Date()),
gtag('config', 'G-XXXXXXXXXX'),
</script>Method 2: Use a Browser Extension
If looking at code isn't your thing, browser extensions can make this process painless. They are designed to detect what technologies and trackers are running on a website.
- Google Tag Assistant Legacy: A Chrome extension made by Google that specifically identifies Google tags (Analytics, Tag Manager, Ads conversion tracking) on a page.
- Wappalyzer: This extension is fantastic for seeing the entire tech stack of a website. It will show you if Google Analytics is installed in just one click on its icon in your toolbar.
- Ghostery: A popular privacy-focused extension that blocks trackers, Ghostery will also show you a list of all trackers it finds on a site, including Google Analytics.
Just install one of these, navigate to your site, and click the extension icon to see if Google Analytics is active.
How to Fully Remove Google Analytics from Your Site
The exact steps for removing the GA code depend on how you added it in the first place. Below are instructions for the most common website platforms and setups.
For WordPress Websites
WordPress is the most popular CMS, and there are two common ways GA is added: with a plugin or directly into the theme files.
1. Removing GA Added via a Plugin
Using a plugin is the most common and easiest method. If you used a tool like Google Site Kit, MonsterInsights, GA Google Analytics, or a header/footer script plugin, the solution is simple.
- Log into your WordPress admin dashboard.
- In the left-hand menu, navigate to Plugins > Installed Plugins.
- Find the plugin responsible for adding the Google Analytics code.
- Click Deactivate. This will stop the plugin and its tracking code from running.
- Once deactivated, click Delete to permanently remove the plugin and its settings from your site.
After deleting the plugin, clear your website's cache (and your browser cache) and re-check with one of the "Find the Code" methods above to confirm it’s gone.
2. Removing Code Manually from Theme Files
If you or your developer added the code snippet directly into your theme's files, you'll need to edit those files to remove it.
Warning: Editing theme files can break your site if done incorrectly. It's always best practice to create a backup of your site before proceeding.
- In your WordPress dashboard, go to Appearance > Theme File Editor.
- You'll likely see a warning about editing theme files — click "I understand" to proceed.
- On the right side, under "Theme Files," look for the file named header.php (Theme Header). This is where the tracking code is almost always located.
- Click to open header.php. Scan the file for the Google Analytics JavaScript snippet you identified earlier. It will usually be found right before the closing
</head>tag. - Carefully select the entire
<script>...</script>block and delete it. - Click the Update File button to save your changes.
Some themes use action hooks via the functions.php file to inject code. If you can't find it in header.php, this is the next place to check.
For Shopify Stores
Shopify makes it incredibly easy to add Google Analytics, and just as easy to remove it.
- Log into your Shopify Admin dashboard.
- In the left menu, go to Online Store > Preferences.
- Scroll down until you see the Google Analytics section.
- You will see a box labeled "Google Analytics account." The code snippet or GA4 measurement ID will be pasted here.
- Delete all the text from this box, leaving it completely empty.
- Click Save at the top of the page.
In some rare cases, the code might be hardcoded into your theme's liquid files. If removing it from Settings doesn't work, go to Online Store > Themes. Click the three dots next to your live theme, select Edit Code, and check the theme.liquid file for the code snippet.
For Squarespace, Wix, or Other Website Builders
Most modern website builders operate on a similar principle to Shopify. They don't want you messing with code directly, so they provide a dedicated field for you to paste tracking IDs or code snippets.
- On Squarespace: Go to Settings > Website > External API Keys. Look for the "Google Analytics" field and delete your Measurement ID (the
G-XXXXXXXXXXvalue). - On Wix: Go to Marketing & SEO > Marketing Integrations. Find the Google Analytics connection and either disconnect it or click the three dots and choose "Remove."
For other builders, look for sections named "Integrations," "Analytics," "Tracking Tools," or "Custom Code" in your site’s settings.
For a Custom-Coded Website
If your website is built from scratch with HTML, CSS, and JavaScript, you have direct access to the files.
- Connect to your website's server via FTP or use your code editor.
- Navigate to the file or files that contain the
<head>section of your site. This could beindex.html,header.html, or a similar template include file. - Open the file(s) and locate the Google Analytics script.
- Delete the entire block of code, from the opening
<script>tag to the closing</script>tag. - Save the file and upload the updated version to your server.
Don't Forget: Delete Your Google Analytics Property
Just removing the code from your site stops future data collection. But all your historical data still exists on Google's servers. If your goal is to fully purge your presence from GA (especially for privacy reasons), you should also delete your Google Analytics Property.
- Log into your Google Analytics account.
- Click Admin (the gear icon) in the bottom-left corner.
- In the "Property" column, make sure the correct website property is selected.
- Click on Property Settings.
- In the top right, click Move to Trash Can.
- Follow the on-screen prompts to confirm. The property and its historical data will be permanently deleted after 35 days.
Final Thoughts
Removing Google Analytics from your website is a straightforward process once you know where the tracking code was originally placed. Whether you're turning off a plugin in WordPress, clearing a settings box in Shopify, or deleting code from your theme files, you can get it done in just a few minutes, giving you a clean slate for your site's analytics and privacy.
After removing a tool or migrating to a new one, the real challenge is turning all that collected data into smart decisions. Having your marketing and sales data connected is essential, but building reports is often a manual, time-consuming process. We built Graphed to be your AI data analyst, connecting all your sources (like Google Analytics, Shopify, and your ad platforms) so you can create real-time dashboards and get answers instantly, just by asking in plain English. This hands-off approach gives you back the hours you'd otherwise spend wrestling with data, so you can focus on growth.
Related Articles
How to Enable Data Analysis in Excel
Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.