Stape/Documentation

Custom Loader power-up

Updated Mar 28, 2025

Overview

Use Custom Loader to minimize the impact of ad blockers and browsers with Intelligent Tracking Prevention (ITP) 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 AdBlockers and ITP.

How to set up the Custom Loader power-up

1. Log in to your stape.io account.

2. Select your sGTM container on the dashboard.

Select your sGTM container on the dashboard

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

Сlick the Use button next to the Custom Loader panel

4. Toggle the Custom Loader switch.

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. Here’s how to find web GTM ID.
  • GA4 ad block bypass - toggle to reduce the impact of ad blockers on the GA4 tracking code. This setting will affect all container domains. After enabling it, be sure to debug both the web and server GTM containers.
  • Same Origin Path - ensures that requests to the server GTM container appear to come from the same domain as the website. Learn more.
  • Platform - the web GTM code differs for each eCommerce platform. Select your platform, or choose "Other" if yours is not on the list.
Configure Custom Loader settings

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/plugin/extension for your platform:

2. Back on 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.

Follow the instructions on the Configuration panel

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 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 CDN - available only if the selected domain has an active Stape CDN. If enabled, the container will be loaded from a server closer to your site visitors.
  • Use original GTM code - if enabled, gtm.js will not be replaced and your GTM container ID will not be encrypted. With this option enabled, the protection against adblockers will be much lower.
  • Generate with Cookie Keeper - available if you have the Cookie Keeper power-up active. If enabled, the code will also add Cookie Keeper operation along with GTM loading.

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

Instructions on how to add a Custom Loader

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.

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

If everything is correct, you should see the Google Tag Manager request URL and “200 OK” Status Code.

Testing Custom Loader
Can’t find what you are looking for?