Do you find all information about us and our services?
Extensions by Category
👽 6. Stealth Mode: Bypassing AdBlockers
"Stealth Mode" is one of the most powerful features of the JaJuMa Matomo Analytics extension.
It allows you to recover analytics data that would otherwise be lost due to ad blockers, giving you a more complete and accurate picture of your website traffic.
❓ 6.1 The Problem: How AdBlockers Impact Your Data
Ad blockers are browser extensions used by a significant portion of internet users.
They work by maintaining "filter lists" of known domains and URL patterns associated with advertising and tracking services.
When you visit a website, the ad blocker scans all outgoing network requests.
If a request's URL matches an entry on its filter list
(e.g., a request to your-matomo-server.com/matomo.php), it is blocked before it ever leaves the browser.
This means that for every visitor using an ad blocker, you are not collecting any analytics data, leading to under-reported traffic, pageviews, and - most critically - conversions.
🔑 6.2 The Solution: Proxying Tracking Requests
Stealth Mode solves this problem by routing tracking data through your own Magento server, which acts as a proxy. This makes the tracking requests invisible to ad blockers.
Here's how it works:
-
Without Stealth Mode:
--(Blocked by AdBlocker)-->[matomo.yourdomain.com] -
With Stealth Mode:
--(Looks like normal site traffic)-->[your-magento-store.com/custom/endpoint]--(Forwarded server-side)-->[matomo.yourdomain.com]
Because the browser is sending data to a URL on your store's own domain, the ad blocker sees it as a legitimate, first-party request and does not block it. Your Magento server then securely forwards this data to your Matomo instance on the backend, completely hidden from the user's browser.
🔧 6.3 Stealth Mode Configuration
Navigate to JaJuMa -> Matomo Analytics -> Configuration -> Javascript Tracking
and find the Stealth Mode subsection.
Use Stealth Mode / Avoid AdBlockers
- Yes: Enables Stealth Mode.
- No (Default): Tracking requests are sent directly to your Matomo site and may be blocked.
💡 Pro Tip:
To use Stealth Mode, you must have configured the Tracker Access Token in the General configuration section.
Custom JS Tracker File Name
When Stealth Mode is enabled, the matomo.js tracking file is also served from your Magento server. This field allows you to give it a custom name to make it less identifiable.
- Format: Enter the name without the
.jsextension. - Example:
myshop-trackerwill result in the file being served asmyshop-tracker.js. - If left empty, a default name (
mtmjajuma.js) is used. Remember to flush your Magento cache after changing this.
Custom Router Tracker
This defines the custom endpoint on your Magento store that will receive the tracking data.
- Format: Use only letters (a-z, A-Z), numbers (0-9), or underscores (
_). The first character must be a letter. - Example:
mtm_endpoint - If left empty, a default route (
rest/V1/mtmjajuma/) is used.
Http Method For Stealth Mode
This setting determines the HTTP protocol version used for the proxy request.
- HTTP/2 (Default): Suitable for most modern server environments.
- HTTP/1.1: Use this only if you encounter errors related to HTTP/2 in your server logs.
🚀 6.4 High-Performance Tracking: The Standalone Script
For high-traffic sites, processing proxy requests through the main Magento application can add a small amount of overhead. The standalone tracker script is a high-performance alternative that moves this logic into a separate, lightweight PHP file, reducing the server footprint.
Use Standalone Tracker Script
- Yes: Enables the use of the standalone script.
- No (Default): The proxy is handled by the Magento application.
Standalone Tracker Script URL
The public URL path to your standalone tracker script.
- Default:
tracker.php
Setup Instructions for the Standalone Script
⚠️ Warning:
These steps require technical expertise and server access.
We do not provide free support for custom environment configurations.
-
Click the Download
tracker.phpbutton in the configuration screen to get the script file. -
Open the downloaded
tracker.phpfile in a text editor. -
Add your Access Token: In line 7, replace
'YOUR_TOKEN'with your Matomo Tracker Access Token (the one with admin access).const WRITE_ACCESS_TOKEN = 'YOUR_TOKEN'; -
Add your Matomo URL: In line 12, replace
'YOUR_MATOMO_URL'with the full URL to your Matomo instance.const MATOMO_URL_TRACKER = 'YOUR_MATOMO_URL'; -
Upload the Script: Copy the modified
tracker.phpfile to your Magento server's public root directory:/magento_root/pub/. -
Webserver Configuration (Nginx): If you use Nginx, you must add a location block to your virtual host configuration to ensure the
tracker.phpfile is processed correctly.
Add the following code before the generic.phplocation block that denies access:
# Allow standalone Matomo tracker script
location ~ ^/tracker.php$ {
try_files /tracker.php =404;
fastcgi_pass fastcgi_backend;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off";
fastcgi_param PHP_VALUE "memory_limit=756M \n max_execution_time=18000";
fastcgi_read_timeout 600s;
fastcgi_connect_timeout 600s;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Banned locations (only reached if the earlier PHP entry point regexes don't match)
location ~* (\.php$|\.phtml$|\.htaccess$|\.git) {
deny all;
}
📞 Need Help?
Still have questions or need help with your configuration? Our expert team is here to assist. Please don't hesitate to contact our support team for personalized assistance.
Ready to unlock these features for your store?
The JaJuMa Matomo Analytics is the all-in-one solution for privacy-focused, performance-friendly analytics in your Magento store.
Find all you need to know and more valuable insights about Hyvä and Magento.
Expertly curated by JaJuMa:
Your central resource for everything Hyvä.
Your central resource for everything Magento.