More and more questions arise about how to make Google Analytics 4 (GA4) tracking reliable, especially with the growing influence of adblock detected bypass. Many users are seeking solutions on how to bypass adblock detection and maintain accurate tracking, leading to a surge in inquiries about how to get past adblock detection without compromising data integrity. Approaches like Google Analytics cookieless tracking are also gaining attention, as businesses look for ways to preserve data quality while adapting to stricter privacy standards.
That’s why we've developed a powerful feature for our Custom Loader power-up – Enhanced ad blocker protection, which:
Activates encryption for GA4 requests.
Enhances the resistance of your GA4 scripts against adblock blockers bypass.
Protects the integrity of your tracking code and preserves valuable data.
How does “Enhanced ad blocker protection” work?
When the Google Analytics tracking code is triggered, it gathers data about the visitors to your website.
Each action or event (e.g., pageview, click, transaction) triggers a separate request to gather the information.
This data can be lost if the visitor uses an ad blocker, which identifies patterns in the request URL (e.g., "/g/collect") to flag data collection. Even if you use a server-side tracking for GA4, ad blockers can still block requests using the /g/collect pattern used by GA4 events. Our “Enhanced ad blocker protection” encrypts these requests, making them unrecognizable to ad blockers.
GA4 processes the requests by grouping individual events and associating them with the corresponding session.
How to activate “Enhanced ad blocker protection”?
This feature is available for all users that are hosting server GTM container on Stape. If you don’t have a Stape account, please sign up and follow a detailed guide on how to set up server-side tracking in our blog.
Enhanced ad blocker protection - when this option is enabled, all your requests to the server sGTM will be encrypted so that ad blockers cannot block them based on request patterns.
Same Origin Path - If you have the same origin configured, specify the path used, and both GTM and GTAG JS will be loaded via the same origin. Learn more about the same-origin approach for server GTM here.
Platform - the web GTM code differs for each eCommerce platform. If you are using Stape applications for CMS, select the platform from the list. Otherwise, select the “Other” option to generate a JS snippet. You can find out more about Stape Conversion Tracking apps for CMS on our page.
Setup for popular platforms
If you use the Shopify, WordPress, Magento, BigCommerce, Wix, or PrestaShop platform, you’ll need a respective app/plugin/extension developed by Stape to set up Custom Loader.
1. Download and configure the app for your platform:
2. Go back to the Custom Loader setup page. Once you’ve entered all the Code & Setup information, click the Generate button.
3. Follow the instructions on the Configuration panel to set up Custom Loader in your app.
Setup for other platforms
If you select the Other platform, you will be given a JS code to use on your site instead of the standard GTM loader. To configure the code, enter the following extra information:
User identifier type - available if the “Generate with Cookie Keeper” option is active (see below). The recommended method of identification is a cookie. For more details, see how to choose a User Identifier.
Cookie name - define the name of the first-party cookie to use as a user identifier.
You can click Advanced settings to enter additional information:
Data Layer variable name - specify if you use a non-standard ‘dataLayer’; otherwise, leave it empty.
Generate with Cookie Keeper - available if you have the Cookie Keeper power-up active. If enabled, the code will also add the Cookie Keeper operation along with GTM loading.
Set _xsd localStorage only after consent - when enabled, Stape stores the ad-blocker status in _xsd localStorage only after analytics_storage consent is granted in Google Consent Mode. Without consent, detection still runs, but the result is not saved between page visits. If disabled, saving to localStorage will occur regardless of the consent status.
6. Click Generate. You will then be given instructions on how to add a Custom Loader to your site (or a JS code if you selected the “Other” platform).
Make the necessary changes on your website (add the code), or in the Stape applications you use.
When adding the Custom Loader to the site, make sure you also remove the standard GTM loader if you have one.
Test the setup of Custom Loader
To check if everything works correctly, right-click on any website page → click Inspect → open the Network tab. Then, enter your custom subdomain or the same origin path if used.
If everything is correct, you should see the Google Tag Manager request URL and “200 OK” Status Code.
Below is an example of encrypting the GA4 request with the active Custom Loader and enhanced ad blocker protection toggle:
And here is what it looks like without the Custom Loader and without enhanced ad blocker protection configured:
Ad Blocker Info
While Custom Loader helps you bypass blockers, Ad Blocker Info power-up shows you how many of your visitors actually use them. It adds a header to every sGTM request and returns true if an ad blocker is on, and false if not.
This way, you see the real share of traffic that hides ads and decide if you need to change ad placements or budget.
Note: Ad Blocker Info only works once the Custom Loader is active.
3. Click Power-ups, then click the Use button next to the Ad blocker info panel.
4. Toggle the Ad blocker info switch and click Save changes.
Test Ad Blocker Info
To check that the Ad Blocker Info power-up works properly, open your sGTM container’s Preview mode, trigger some events on your website, and then check if those requests include X-user-adblocker headers (True if the ad blocker is active and False if it is not).
Measure results of server-side tracking with Stape
With Stape Analytics you can observe how “Enhanced ad blocker protection” has influenced your Google Analytics 4 performance.
It helps to understand how many users you have with technologies that interfere with tracking (adblockers). But the number of users depends entirely on the audience that visits your site, in some cases it is 5% of the audience, in some 50%.
If you would like to activate Stape Analytics and see the value of using server side, simply go to your Stape sGTM container to turn on Analytics.
Measure results of server-side tracking with Stape
Use case
A client activated Stape Analytics in early November. Initially, they observed that only 8.55% of their website visitors were being tracked by Google Analytics 4, which corresponds to the percentage of visitors who had ad blockers preventing GA4 tracking.
Results of server-side tracking with Stape
The client was losing valuable data from a significant portion of their website visitors, as users with ad blockers were not being tracked properly by GA4. This limited the accuracy of their analytics and the insights they could gain for optimizing their marketing strategies.
After activating "Enhanced ad blocker protection" toggle within Stape's Custom Loader in late November, the client observed a significant improvement in the tracking accuracy. The percentage of website visitors with ad blockers increased to 35% on average, and these users were successfully tracked by GA4 thanks to the bypass functionality.
Results of server-side tracking with Stape
i
Case study: 20% of data recovered from tracking prevention | Peak Metrics
Challenge: losing a massive volume of critical user data due to ad blockers and browser limitations like Safari's Intelligent Tracking Prevention (ITP).
Solution: server-side tracking implementation via Stape using a custom subdomain (e.g., sgtm.yoursite.com) and identifier backups to route data securely through a resilient, first-party server environment.
Results: successful recovery over 20% of data blocked by ITP and 3.3% blocked by ad blockers, including a 30.6% recovery of lost purchase events during a 10-day test.
Ivanna is a Lead Content Manager at Stape and a certified author on Clutch and KyivPost. She writes high-quality content on server-side tracking to help businesses optimize strategies and analytics.
Avoid Google Tag Manager and GA4 blocking by ad blockers
Discover how ad blockers interfere with Google Tag Manager and GA4, and how server-side tracking with Stape's Custom Loader ensures reliable data collection.
Comments