||||
-|-|
| 概要 | Matomo Analytics は、DiscourseでMatomo分析を有効にするためのスクリプトです。
| リポジトリリンク | https://github.com/discourse/discourse-matomo-analytics
|Discourseテーマが初めての方へ | Discourseテーマの使用に関する初心者ガイド
機能
Matomo はオープンソースの分析プラットフォームです。ユーザーは、セルフホスティングか、クラウドでのプロフェッショナルホスティングの支払いを選ぶことができます。
Matomoは以前はPiwikと呼ばれていました。名称変更の詳細については、Piwik is now Matomo - Announcement - Analytics Platform - Matomo を参照してください。
DiscourseフォーラムでMatomo分析を有効にするには、公式のテーマコンポーネントをインストールするだけです。
Matomo API v1.5以降で有効
テーマインストールガイド に従って、以下のURLからインポートします:
https://github.com/discourse/discourse-matomo-analytics.git
以下が表示されます
ホストURLとウェブサイトIDを入力します
テーマコンポーネント「Matomo Analytics」をアクティブなテーマに追加します。
これで完了です!
設定
名前
説明
host url
http://またはhttps ://を除くホストURL
website id
exclude groups
トラッキングから除外するグループのカンマ区切りリスト(例:管理者、スタッフ)
user id tracking
現在のユーザーオブジェクト上の識別フィールド名(例:id、username、external_id)。
subdomain tracking
discourseがサブドメインにあると仮定して、メインドメインとサブドメイン全体で訪問者を追跡します。
do not track
訪問者が追跡されたくない場合、トラッキングリクエストが送信されないようにします。
disable cookies
すべてのファーストパーティクッキーを無効にします。次のページビュー時に、このウェブサイト用の既存のMatomoクッキーが削除されます。
クレジット
@mattab 、@brahn 、@tagtomat 、@simonに感謝します
当社でホストされていますか? テーマコンポーネントは、Standard、Business、Enterpriseプランでご利用いただけます。
「いいね!」 38
chrisblech
(Christoph Blechschmitt)
2016 年 10 月 31 日午後 2:04
22
Thanks for this howto, works fine for me.
In order to comply with the European laws, users must have the possibility to reject piwik’s cookie. Piwik offers a really simple solution for this, by including an IFrame .
Unfortunately, Discourse doesn’t allow iframe tags in posts…
Does anyone see a way to include this piwik iframe in Discourse TOS ?
Thanks.
「いいね!」 1
I just created a new “Matomo Analytics” theme component, and updated the instructions on how to set it up.
Could you give it a try? Please also remember to remove the original custom scripts.
「いいね!」 8
Looks good on first sight. No error in javascript console. Requests to piwik.php being in the webserver log again.
Statistics in Matomo are available as well.
「いいね!」 5
sam
(Sam Saffron)
2018 年 10 月 23 日午後 10:27
32
Is this iframe thing still a concern?
「いいね!」 1
chrisblech
(Christoph Blechschmitt)
2018 年 10 月 24 日午後 10:54
33
Hey @xrav3nz your component works great - thanks!
Yes it is. Opt-out should be possible, and Matomo provides this via including an iFrame: see Matomo documentation
「いいね!」 3
This doesn’t appear to be working for me at the moment? I can add the component, and add the correct URL and siteid, but it doesn’t render anything:
I added the comments around the code to find it quicker in the page:
「いいね!」 1
darix
(Darix)
2018 年 12 月 17 日午後 9:27
35
We are on beta 6+git1 on our instance
Inline JavaScripts in themes and components are automatically extracted to an external “theme JavaScript” file.
Could you try checking the one immediately after your comments?
「いいね!」 7
This is at the main page on https://discuss.pixls.us :
Edit
Hold on, I’ve got a new hash on the file on recent refresh, it looks like the code is there. Thank you @xrav3nz !
Looks like it’s working now - not sure what I was doing wrong yesterday - user error.
「いいね!」 5
downey
(Michael Downey)
2019 年 4 月 19 日午前 12:45
38
So I have the JS loaded into the theme customizations, and the external “theme JavaScript file”* is linked in my test browser, just under where I inserted it like in the screenshot in a few posts earlier … BUT the requests aren’t coming through to the Matomo tracking web server.
(Tracking works fine for other non-Discourse sites, FWIW.)
Has anyone else seen that happen?
* e.g. https://discourse-cdn.example.com/standard11/theme-javascripts/{numeric_string}.js?__ws=my-discourse-forum.example.org
surety
(Ryan)
2019 年 9 月 19 日午前 3:04
39
コンポーネントをありがとうございます!
トラッキングコードが「Anonymous」というカスタム変数を送信している理由がわかりません。これはあなたの特定の Matomo 設定に固有のものではないでしょうか?全員に必要とは思えません。
_paq.push(['setCustomVariable', 1, 'Anonymous', !currentUser, 'visit']);
サブドメイン上の Discourse とメインサイト間の訪問者を追跡できるように、数行を追加 しました。必要であればプルリクエストを送信します。
Content-Security-Policy ヘッダー内で Matomo の URL をホワイトリストに登録する必要があります。管理設定「content_security_policy_script_src」を検索し、ドメイン(https://付き )をそこに追加してください。
「いいね!」 6
danb35
(Dan)
2019 年 11 月 9 日午前 12:33
41
私のインストール環境でこれが動作しないことに困っています。コンポーネントをインストールし、テーマに追加しましたが、Matomo からサイトに関連するデータがないと表示されています。設定は正しいと思うのですが:
しかし、ブラウザのコンソールでは次のエラーが表示されます:
…そして、Matomo でサイトを確認すると、次のようになります:
何が足りないのでしょうか?
追記:さらに調査したところ、JavaScript コンソールのエラーは Chrome(Mac の最新バージョン)では表示されず、Firefox のみで発生することがわかりました。また、Matomo には現在いくつかの結果が表示されていますが、Firefox は明らかに欠けています。訪問者のほとんどは Chrome を使用しており、例外は 1 名のみで、Safari を使用しています。
danb35
(Dan)
2019 年 11 月 11 日午後 3:03
42
これについてご意見はありますか?
この投稿:
I am facing the same problem…I am using 53.0.2. I removed all history, cookies and cache… Didn’t work for me.
Reading time: 2 mins 🕑
Likes: 1 ❤
では、Firefox の「追跡しない」設定が原因かもしれないと示唆されていますが、自サイトに対してこれを無効にしても、Firefox のウェブコンソールでは同じエラーが表示されます。それに、いずれにせよ Firefox はこれをトラッカーとして認識していないようです:
danb35
(Dan)
2019 年 11 月 13 日午前 10:52
44
ありがとうございます。残念ながら、同じエラーが発生したままです:
eextra
(Sylwia)
2020 年 1 月 25 日午後 9:48
49
この 2 つのフィールドは入力が必要ですか?よくわかりません。