Clarify behaviour of using both matomoAsyncInit and _paq.push()
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
まず、matomoAsyncInit、Matomo.getAsyncTracker()、_paq.push()、addTracker() の間で文書化されている相互作用を追跡します。最初の tracker とキューに入れられたコマンドが処理される順序を確認し、その後、確認された tracker の動作と、getAsyncTracker() の呼び出しを繰り返す必要があるタイミングを説明するよう、関連する開発者向けドキュメントを更新します。
索引モデルが issue の本文から書いたものです。
説明
I have not found any clear documentation what happens if you use _paq push in combination with matomoAsyncInit. This could lead to some unexpected behaviour that could not be explained with a simple documentation link.
Given the following tracker integration:
var _paq = window._paq = window._paq || [];
(function() {
var siteIdFirst = 1;
var siteIdSecond = 2;
var urlFirst = 'https://first.matomo.instance/matomo.php';
var urlSecond = 'https://second.matomo.instance/matomo.php';
window.matomoAsyncInit = function() {
var tracker = Matomo.getAsyncTracker(urlSecond, siteIdSecond);
tracker.MyPlugin.disable();
};
_paq.push(['setTrackerUrl', urlFirst]);
_paq.push(['setSiteId', siteIdFirst]);
_paq.push(['trackPageView']);
// regular script tag integration
})();
From the code one could expect that MyPlugin.disable() would be called on the tracker for the second url/site. But, this is not the case.
The call to getAsyncTracker() in matomoAsyncInit will create the first tracker. All queued _paq commands are executed for this instance, overwriting the parameters given to the getAsyncTracker() call and resulting in only a single tracker instance being set up.
Adding _paq.push(['addTracker', urlSecond, siteIdSecond]) before the script tag creation will create that second tracker, but it will not be used inside matomoAsyncInit. The first tracker is being returned there.
It should be clearer that matomoAsyncInit is getting executed before the first tracker instance is created. And the first call to getAsyncTracker() (and the other methods affected) is running all queued _paq commands, requiring to call getAsyncTracker twice if you want to e.g. deactivate a plugin only on the second tracker.
Refs matomo-org/matomo#21976.
- 主要言語
- PHP
- スター
- 58
- フォーク
- 88
- 平均マージ
- 32分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
matomo-org/developer-documentation のほかの issue
-
Documentation enhancement
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
matomo-org/developer-documentation#806 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
matomo-org/developer-documentation#787 · コメント 1 件 ·
matomo-org/developer-documentation の issue をすべて見る
似ている issue
-
PHP workflow streaming requests buffer the full SSE response対応中かも @Winoren が今日担当しました。 オープンreview: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
langgenius/dify#44270 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug customer-reported
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
MagnaCapax/PMSS#1085 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
nunomaduro/collision#375 ·
-
enhancement good first issue hacktoberfest help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
thetheago/laravel-seeder-versioning#19 ·
メンテナーはふだん 1 日以内に返信