Closed Orgoth closed 1 year ago
As a temporary solution I have changed two files.
Template/Variable/MatomoConfigurationVariable.php
$this->makeSetting('disableAlwaysUseSendBeacon', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
$field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoDisableAlwaysUseSendBeaconTitle');
$field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoDisableAlwaysUseSendBeaconDescription');
}),
Template/Tag/MatomoTag.web.js
if (matomoConfig.disableAlwaysUseSendBeacon) {
tracker.disableAlwaysUseSendBeacon();
}
Translation is missing, but not necessary for the usage. TagManager_MatomoConfigurationMatomoDisableAlwaysUseSendBeaconTitle and TagManager_MatomoConfigurationMatomoDisableAlwaysUseSendBeaconDescription
Hi @Orgoth . Thank you for taking the time to create this issue. Probably the easiest workaround would be to, in your Matomo Tag Manager dashboard, create a Custom HTML tag and call the disableAlwaysUseSendBeacon tracker method in that.
Thank you. Your second comment looks like a good improvement suggestion. I will add this issue to our list of issues to be prioritised by our product team.
So, the "temporary solution" seems pretty solid, why didn't you open a PR?
I had a silent hope that it would be adopted by contributors or authors since it is such a simple and easy customization.
Another point was still, currently there is the following point in the system. "MatomoConfigurationMatomoAlwaysUseSendBeaconTitle": "Always use sendBeacon", With the introduction of my workaround, the end user would question why there is the additional item to disable. If he has disabled the first entry "Always use sendBeacon"?! "unchecked"
The other side is then still the effort with all the points that must be met for the contribution before.
Thank you @Orgoth for creating that PR. It was been merged and will be included in the next Matomo 5.x release.
At the moment it is not possible to set disableAlwaysUseSendBeacon to prevent ping requests. This causes adblockers to prevent tracking.
sghiel from matomo tracker was kind enough to point me to this repository. https://github.com/matomo-org/matomo/issues/19864#issuecomment-1340640583
Do you possibly have a suggestion for a workaround that I can set the parameter? Currently, only alwaysUseSendBeacon can be set in the interface.
Thank you very much in advance.