Page tracking with Google Analytics

Last modified by Vincent Massol on 2023/03/13 00:18

cogTrack page views using Google Analytics
TypeXAR
CategoryApplication
Developed by

Ludovic Dubost, Vincent Massol, XWiki Development Team

Active Installs3
Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Only use this extension in XWiki >= 14.10 (this feature was included in XWiki versions <= 14.9).

Installable with the Extension Manager

Description

Some users have raised that this extension started not working for them. The good news is that you don't really need this extension to make XWiki report data to GA. Here's how to do it without this extension:

  • Make sure to disable this extension. You can do this by removing any GA id from the configuration and saving.
  • Follow the Google Analytics documentation to locate your tracking id and to get the HTML code to embed.
  • Inside XWiki, naivgate to the Admin UI and select "Look & Feel" and then "Presentation". Enter the HTML code inside the "HTTP META INFO" section, as the last element for example. Save.

Note: This works for GA UA or GA4 or any version of GA.

Provides an integration for Google Analytics to allow tracking wiki pages.

To use it, navigate to the Admin UI, select "Google Analytics" from the menu as shown in this screenshot:

ga-menu.png

Then simply choose the Analytics mode (Universal or Classic - Check the Google documentation to decide which one is best for you) and fill in your tracking id:

ga-admin.png

If you have multiple subwikis in your wiki, you'll need to configure each subwiki that you wish to track with a tracking id (it can be the same one across wikis). There's currently no way to specify the tracking id once for all subwikis.

Prerequisites & Installation Instructions

We recommend using the Extension Manager to install this extension (Make sure that the text "Installable with the Extension Manager" is displayed at the top right location on this page to know if this extension can be installed with the Extension Manager). Note that installing Extensions when being offline is currently not supported and you'd need to use some complex manual method.

You can also use the following manual method, which is useful if this extension cannot be installed with the Extension Manager or if you're using an old version of XWiki that doesn't have the Extension Manager:

  1. Log in the wiki with a user having Administration rights
  2. Go to the Administration page and select the Import category
  3. Follow the on-screen instructions to upload the downloaded XAR
  4. Click on the uploaded XAR and follow the instructions
  5. You'll also need to install all dependent Extensions that are not already installed in your wiki

Get Connected