Extension:GoogleAnalyticsMetrics

This page is a translated version of the page Extension:GoogleAnalyticsMetrics and the translation is 70% complete.
This extension is professionally maintained by the WikiTeq team.
WikiTeq provides official support for MediaWiki LTS releases only. It may work with other MediaWiki releases.
MediaWiki manüel uzantıları
GoogleAnalyticsMetrics
Sürüm durumu: kararlı
Uygulama Ayrıştırıcı işlevi
Açıklama Google Analytics'ten ölçümler alır
Yazar(lar) Ike Hecht (Tosfosmesaj)
Sürdürücü(ler) WikiTeq team
En son sürüm 1.0.2 (Ocak 2023)
Uyumluluk politikası Uzun Süreli Destek sürümü olan her MediaWiki sürümü için uzantıda karşılık gelen bir dal vardır.
MediaWiki 1.35, 1.39
Veritabanı değişiklikleri Hayır
Composer mediawiki/google-analytics-metrics
Lisans GNU Genel Kamu Lisansı 2.0 veya üstü
İndir
  • $wgGoogleAnalyticsMetricsViewId
  • $wgGoogleAnalyticsMetricsExpiry
  • $wgGoogleAnalyticsMetricsAllowed
Quarterly downloads 6 (Ranked 134th)
Translatewiki.net adresinde mevcutsa, GoogleAnalyticsMetrics uzantısını çevirin
Sorunlar Açık görevler · Hata bildir

GoogleAnalyticsMetrics uzantısı, Google Analytics'ten çeşitli ölçümler alır ve bunları bir ayrıştırıcı işlevi kullanarak bir viki sayfasına ekler. Bu uzantı WikiWorks için oluşturulmuştur.

The GoogleAnalyticsMetrics extension may not be appropriate for your site if you have data security and privacy concerns. The extensions inserts JavaScript code in each page served, and the code causes the client to contact Google services to process and aggregate data. Your site's users will be subjected to tracking and data mining regardless of the Do Not Track or Global Privacy Control browser settings.

Kurulum

  • Setup Google Analytics API by following Step 1 here
  • Install the Google Client Library by following Step 2 here
  • Enable Google Analytics Reporting API in your Google Cloud Console
  • Dosyaları indirin ve extensions/ klasörünüzdeki GoogleAnalyticsMetrics adlı dizine yerleştirin.
    Developers and code contributors should install the extension from Git instead, using:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GoogleAnalyticsMetrics
  • Yalnızca git dizininden yüklerken, PHP bağımlılıklarını uzantı dizinine composer install --no-dev vererek yüklemek için Composer komutunu çalıştırın. (Potansiyel komplikasyonlar için görev T173141 sayfasına bakınız.)
  • LocalSettings.php dosyanızın altına aşağıdaki kodu ekleyin:
    wfLoadExtension( 'GoogleAnalyticsMetrics' );
    
  •   Yapıldı – Uzantının başarıyla yüklendiğini doğrulamak için vikinizde Special:Version seçeneğine gidin.

Kullanım

googleanalyticsmetrics ayrıştırıcı işlevi şu şekilde üç parametre alır:

{{#googleanalyticsmetrics: metric=Name of metric|page=Page Name|startDate=Start date|endDate=End date}}
Metriğin adı
The name of the Google Analytics Metric that should be displayed. The full list of Google Analytics metrics is here. Omit the ga: prefix.
Sayfa Adı
The name of the page. This parameter is only used when the metric is a per page metric.
Başlangıç tarihi
Show the metric since this date (optional). Defaults to 2005-01-01, which is the beginning of time according to Google Analytics.
Bitiş tarihi
Show the metric until this date (optional). Defaults to today.

Her iki tarih parametresi de şu biçimi kullanır: Yıl-Ay-Gün.

Örnekler

Bu örnek, başından sonuna kadar bu site için sayfa görüntülemelerin sayısını gösterir:

{{#googleanalyticsmetrics: metric=pageviews}}

3 Şubat 2011'den bugüne kadar olan oturumların sayısını gösterin.

{{#googleanalyticsmetrics: metric=session|startDate=2011-02-03}}

1 Şubat 2012'ye kadarki ortalama seans süresini göster:

{{#googleanalyticsmetrics: metric=avgSessionDuration|endDate=2012-02-01}}

ParserFunctions uzantısının yardımıyla yalnızca geçen ayın sayfa görüntüleme sayısını gösterin:

{{#googleanalyticsmetrics: metric=pageviews|startDate={{#time:Y-m-d|first day of last month}}|endDate={{#time:Y-m-d|first day of this month}}}}

Veya bunu daha güzel hale getirmek için:

{{formatnum:{{#googleanalyticsmetrics: metric=pageviews|startDate={{#time:Y-m-d|first day of last month}}|endDate={{#time:Y-m-d|first day of this month}}}}}}

Show the number of page views for a page, from the beginning until the end of time:

{{#googleanalyticsmetrics: metric=pageviews|page=Main_Page}}

See this page for some help with formatting this extension's output.

There is also a {{#googleanalyticstrackurl:http://urlhere|link text}} function but it only works if the ga js library has already been loaded.

Yapılandırma parametreleri

$wgGoogleAnalyticsMetricsAllowed
An array containing the name of Google Analytics metrics that are allowed to be retrieved by the extension. Defaults to *, which allows all metrics.
$wgGoogleAnalyticsMetricsEmail
The email address of the Google Analytics account.
$wgGoogleAnalyticsMetricsPath
Path to your certificate key file.
$wgGoogleAnalyticsMetricsViewId
Google Analytics View ID.

Ayrıca bakınız