تحليلات ماتومو

:discourse2: الملخص Matomo Analytics هو مكون قالب لتمكين تحليلات ماتومو على Discourse.
:hammer_and_wrench: رابط المستودع https://github.com/discourse/discourse-matomo-analytics
:open_book: جديد على قوالب Discourse؟ دليل المبتدئين لاستخدام قوالب Discourse

تثبيت مكون القالب هذا

الميزات

Matomo هو منصة تحليلات مفتوحة المصدر. يمكن للمستخدمين الاختيار بين الاستضافة الذاتية أو الدفع لاستضافة احترافية في السحابة.

:mega: كان Matomo يُعرف سابقًا باسم Piwik. انظر Piwik is now Matomo - Announcement - Analytics Platform - Matomo لمزيد من التفاصيل حول تغيير الاسم.

لتفعيل تحليلات Matomo على منتدى Discourse الخاص بك، كل ما عليك فعله هو تثبيت مكون القالب الرسمي.

صالح لـ Matomo API الإصدار 1.5 وما بعده

  1. اتبع دليل تثبيت القالب للاستيراد من العنوان التالي:

    https://github.com/discourse/discourse-matomo-analytics.git
    

    وسترى

  2. أدخل Host URL و Website ID

  3. أضف مكون القالب “Matomo Analytics” إلى قوالبك النشطة.

هذا كل شيء!

الإعدادات

الاسم الوصف
host url عنوان المضيف بدون http:// أو https://
website id
exclude groups قائمة مفصولة بفواصل لمجموعات لاستبعادها من التتبع مثل المشرفين والموظفين
user id tracking اسم حقل تعريف على كائن المستخدم الحالي مثل id أو username أو external_id.
subdomain tracking تتبع الزوار عبر النطاق الرئيسي والنطاقات الفرعية، بافتراض أن Discourse موجود على نطاق فرعي.
do not track بحيث لن يتم إرسال طلبات التتبع إذا لم يرغب الزوار في التتبع.
disable cookies يعطل جميع ملفات تعريف الارتباط من الطرف الأول. سيتم حذف ملفات تعريف الارتباط الموجودة في Matomo لهذا الموقع على عرض الصفحة التالي.

الاعتمادات

شكرًا لـ @mattab & @brahn @tagtomat و @simon


:discourse2: مستضاف من قبلنا؟ تتوفر مكونات القالب للاستخدام في خططنا القياسية والأعمال والشركات.

38 إعجابًا

Thanks for this howto, works fine for me. :thumbsup:

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… :grimacing:
Does anyone see a way to include this piwik iframe in Discourse TOS ?
Thanks.

إعجاب واحد (1)

:wave: 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 إعجابات

Is this iframe thing still a concern?

إعجاب واحد (1)

Hey @xrav3nz :clap: 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)

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 إعجابات

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

شكرًا لك على المكون!

أنا مشوش بشأن سبب إرسال كود التتبع متغيرًا مخصصًا يُدعى Anonymous. أليس هذا مخصصًا لإعدادات Matomo الخاصة بك؟ لا يبدو أنه يجب أن يكون موجودًا للجميع.

_paq.push(['setCustomVariable', 1, 'Anonymous', !currentUser, 'visit']);

لقد أضفت بضعة أسطر بحيث يتتبع الزوار بين discourse على نطاق فرعي وموقع رئيسي. يسعدني إرسال طلب سحب (pull request) إذا كنت ترغب في ذلك.

يجب عليك إضافة عنوان URL الخاص بـ Matomo إلى القائمة البيضاء ضمن رأس سياسة أمان المحتوى (Content-Security-Policy). ابحث عن إعداد المسؤول content_security_policy_script_src وأضف نطاقك (مع https://) هناك.

6 إعجابات

أواجه صعوبة في جعل هذا يعمل على التثبيت الخاص بي. لقد قمت بتثبيت المكون وإضافته إلى سميّتي، لكن Matomo يقول إنه لا توجد بيانات للموقع. أعتقد أن الإعدادات صحيحة:


image
لكنني أرى هذه الرسالة في وحدة تحكم المتصفح:
image
…وعندما أفحص الموقع في Matomo، أرى هذا:

ما الذي فاتني؟

تعديل: كشفت المزيد من التحقيقات أن الخطأ في وحدة تحكم JavaScript يظهر فقط في Firefox، وليس في Chrome (مع أحدث إصدارات كل منهما على جهاز Mac). وأرى الآن بعض النتائج في Matomo، رغم أن Firefox غائب بشكل لافت؛ فجميع الزوار باستثناء واحد يستخدمون Chrome، بينما المستخدم الوحيد الذي لا يستخدم Chrome يستخدم Safari.

هل لديك أي أفكار حول هذا؟ يشير هذا المنشور:

إلى أنه قد يكون بسبب إعدادات “عدم التتبع” في متصفح فايرفوكس، ولكن حتى عندما أقوم بتعطيلها لموقعي، أواجه نفس الخطأ في وحدة تحكم الويب باستخدام فايرفوكس. ولا يبدو أن فايرفوكس يعتبر هذا الموقع أداة تتبع في أي حال:

حاول إزالة الش barre الأخيرة من “https://www.familybrown.org/analytics/” → “https://www.familybrown.org/analytics

إعجاب واحد (1)

شكرًا لك. للأسف، ما زلت أحصل على نفس الخطأ:
image

هل يمكنك تزويدي برابط منتدىكم؟

هل يجب تعبئة هذين الحقلين؟ أنا لا أفهمهما حقًا.