Custom Loader power-up
Updated Mar 20, 2026
Overview
Use Custom Loader to minimize the impact of ad blockers on your Google Tag Manager (GTM) and Google Analytics 4 (GA4) scripts.
Benefits of Custom Loader
- Privacy regulations compliance - turns all cookies into first-party cookies by modifying gtag.js and gtm.js loading path.
- More reliable and complete data - makes GTM and GA4 scripts resistant to ad blockers.
How to set up the Custom Loader power-up
2. Select your sGTM container on the dashboard.

3. Click Power-ups, then click the “Use” button next to the Custom Loader panel.

4. Toggle the Custom Loader switch.

5. Configure Custom Loader with the following settings:
- Domain - choose one of the domains linked to your container.
- Web GTM ID - paste your web Google Tag Manager ID.
- 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:
- Shopify: download link, configuration guide.
- WordPress: download link, configuration guide.
- Magento: download link, configuration guide.
- BigCommerce: download link, configuration guide.
- Wix: download link, configuration guide.
- PrestaShop: download link, configuration guide.

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:

Comments