Extension:Google Analytics Integration/de

Category:Unmaintained extensions/de#Google%20Analytics%20Integration/de Category:GPL licensed extensions/de
MediaWiki-Erweiterungen
Google Analytics Integration
Freigabestatus: ohne WartungCategory:Unmaintained extensions/de
Einbindung Benutzeraktivität Category:User activity extensions/de, Hook Category:Hook extensions/de
Beschreibung Automatically inserts Google Universal Analytics (and/or other web analytics) tracking code at the bottom of MediaWiki pages
Autor(en) Tim Laqua, Dāvis Mošenkovs
Letzte Version 3.0.1 (2017-10-29)
MediaWiki 1.23+Category:Extensions with manual MediaWiki version
PHP 5.4+
Datenbankänderungen Nein
Lizenz GNU General Public License 2.0 oder neuer
Herunterladen Category:Extensions in Wikimedia version control/de
Beispiel Projects by Davis Mosenkovs (view page source at the bottom)
  • $wgGoogleAnalyticsAccount
  • $wgGoogleAnalyticsOtherCode
  • $wgGoogleAnalyticsAnonymizeIP
  • $wgGoogleAnalyticsIgnoreNsIDs
  • $wgGoogleAnalyticsIgnorePages
  • $wgGoogleAnalyticsIgnoreSpecials
Public wikis using 1,302 (Ranked 194th)
Übersetze die Google Analytics Integration-Erweiterung
Category:All extensions/deCategory:Extensions not in ExtensionJson

The Google Analytics Integration extension inserts Google Universal Analytics (and/or other web analytics) tracking code in every page viewed. Exclusion of specific pages, namespaces, special pages and all pages for specific groups of users is configurable.

This extension may be outdated for your needs. If you are using the new Global Site Tag for Google Analytics, try using Extension:HeadScript instead.

Alternatively you can put Google Analytics tag directly into MediaWiki:Common.js of your wiki.

Installation

  • Die Erweiterung herunterladen und die Datei(en) in ein Verzeichnis namens googleAnalytics im Ordner extensions/ ablegen.
    Entwickler und Code-Beitragende sollten stattdessen die Erweiterung von Git installieren, mit:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/googleAnalytics
  • Folgenden Code am Ende deiner LocalSettings.php -Datei einfügen:
    require_once "$IP/extensions/googleAnalytics/googleAnalytics.php";
    // Replace xxxxxxx-x with YOUR GoogleAnalytics UA number
    $wgGoogleAnalyticsAccount = 'UA-xxxxxxx-x'; 
    
    // Optional configuration (for defaults see googleAnalytics.php)
    
    // Add HTML code for any additional web analytics (can be used alone or with $wgGoogleAnalyticsAccount)
    $wgGoogleAnalyticsOtherCode = '<script type="text/javascript" src="https://analytics.example.com/tracking.js"></script>';
    
    // Store full IP address in Google Universal Analytics (see https://support.google.com/analytics/answer/2763052?hl=de for details)
    $wgGoogleAnalyticsAnonymizeIP = true; 
    
    // Array with NUMERIC namespace IDs where web analytics code should NOT be included.
    $wgGoogleAnalyticsIgnoreNsIDs = [
        500
        ];
    
    // Array with page names (see magic word {{FULLPAGENAME}}) where web analytics code should NOT be included.
    $wgGoogleAnalyticsIgnorePages = [
        'PageName',
        'NamespaceName:PageName'
        ];
        
    // Array with special pages where web analytics code should NOT be included.
    $wgGoogleAnalyticsIgnoreSpecials = [
        'Userlogin',
        'Userlogout',
        'Preferences',
        'ChangePassword',
        'OATH'
        ];
        
    // Use 'noanalytics' permission to exclude specific user groups from web analytics, e.g.
    $wgGroupPermissions['sysop']['noanalytics'] = true;
    $wgGroupPermissions['bot']['noanalytics'] = true;
    
    // To exclude all logged in users, give 'noanalytics' permission to the 'user' group, i.e.
    $wgGroupPermissions['user']['noanalytics'] = true;
    
  • Yes Erledigt – Navigiere zu Special:Version in deinem Wiki, um zu überprüfen, ob die Erweiterung erfolgreich installiert wurde.Category:Extensions not using extension registration/de
The following options were removed in version 3.0.0:
  • $wgGoogleAnalyticsAddASAC
  • $wgGoogleAnalyticsIgnoreSysops
  • $wgGoogleAnalyticsIgnoreBots

Verwendung

  1. Create a Google Analytics account.
  2. Locate your UA number.
    • For the legacy code block, it can be found on the following line:
      _uacct="UA-xxxxxxx-x";
      
    • For the new ga.js code block, it can be found on the following line:
      var pageTracker = _gat._getTracker("UA-xxxxxxx-x");
      
  3. Follow installation instructions.
  4. Google Analytics stats should start populating within 24-48 hours.

Siehe auch

Category:Google extensions/de Category:Web Analytics extensions/de Category:Statistics extensions/de
Category:All extensions/de Category:Extensions in Wikimedia version control/de Category:Extensions not in ExtensionJson Category:Extensions not using extension registration/de Category:Extensions which add rights/de Category:Extensions with manual MediaWiki version Category:GPL licensed extensions/de Category:Google extensions/de Category:Hook extensions/de Category:SkinAfterBottomScripts extensions/de Category:Statistics extensions/de Category:UnitTestsList extensions/de Category:Unmaintained extensions/de Category:User activity extensions/de Category:Web Analytics extensions/de