
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:
| 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 is a setting inside the Custom Loader power-up, not a standalone feature. To turn it on, you'll first need to set up Custom Loader for your container — the toggle is simply one of the options you'll configure along the way.
1. Log in to your Stape account and select your sGTM container from the dashboard.

2. Go to Power-ups and click Use next to the Custom Loader panel.

3. Toggle the Custom Loader switch to enable it and click Save changes.

4. In the Code & Setup information section, configure the following settings:

Select your platform and click Generate. You’ll get configuration and app installation instructions in the Configuration panel for your selected platform. Follow the app installation guide.
Note:

1. Select Other. You can also configure Advanced settings:
dataLayer.2. Click Generate and add the provided code to your website.
Note:

To verify the setup is working:

Note:
GTM Environments let you load a specific version of your container (e.g., staging or development) instead of the published version. If you use environments, you need to manually add the environment parameters to your Custom Loader code.
1. Get your environment parameters.



2. Add the environment parameters to the head snippet.
In the generated Custom Loader head code, locate the E.src line.

Append the parameters to the query string:
E.src=f+"/"+i+".js?"+c+v+">m_auth=XXXX>m_preview=env-N>m_cookies_win=x"Be sure to replace gtm_auth, gtm_preview, and gtm_cookies_win in the example with your own respective parameters. Also, it is highly recommended to add new parameters at the end of the URL string to avoid breaking anything (i.e., do NOT add them in the middle like E.src=f+"/"+i+".js?"+c+new parameters+v).
3. Add the environment parameters to the body snippet.
Do the same for the body snippet:

Append the same parameters to the iframe URL in the body snippet (replace the gtm_auth, gtm_preview, and gtm_cookies_win in the example with your own respective parameters):
<noscript><iframe src="https://your-subdomain.stape.work/ns.html?id=GTM-XXXXXX>m_auth=XXXX>m_preview=env-N>m_cookies_win=x" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>| Environment parameters are tied to a specific environment. If you regenerate your Custom Loader snippet (e.g. after changing settings), you'll need to re-add the environment parameters manually, since they are not saved by Custom Loader. |
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:
1. Log in to your Stape account and select your sGTM container from the dashboard.

2. Go to Power-ups and click Use next to the Ad Blocker Info panel.

3. Toggle the Ad Blocker Info switch to enable it and click Save changes.

To use the header, create a variable with the type Request Header and enter the X-User-Adblocker name:

Open your sGTM container's Preview mode and trigger events on your website. Click on the Incoming HTTP Request.

In the incoming requests, check for the X-User-Adblocker header - it’ll show true if an ad blocker is active, or false if it isn’t.

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.
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.

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.

Case study: 20% of data recovered from tracking prevention | Peak Metrics
Comments