Jahia Google Analytics

November 14, 2023

There are two modules available on the Jahia store that you can use to add Google Analytics functionality for your sites.

  • Jahia Google Analytics
    Adds the Google Analytics tag to your Jahia website and enables you to view tracking metrics in Google Analytics
  • Google Analytics for jExperience
    Enables you to view events in Google Analytics that occur when a personalization or an AB test variant displays on your site

Enabling and using Jahia Google Analytics

The Jahia Google Analytics module enables you to add the Google Analytics tag to your Jahia website. The Google Analytics tag is JavaScript code that performs tracking on your website so that you can capture your metrics in Google Analytics.

Note: You do not require this module if you have added the Google Analytics tag through the Google Tag Manager or from your own module, for example, if your developers coded a custom filter.

Installing and deploying Jahia Google Analytics

Install the Jahia Google Analytics module as any other Jahia module and ensure that it is activated on your website. For more information on installing modules, see Installing a module tutorial.

Configuring Jahia Google Analytics

You first require your Google Analytics Tracking ID to configure the module. Then you add the Tracking ID information to your site in Jahia.

To configure Jahia Google Analytics:

  1. First, get your Tracking ID:
    1. Login to Google Analytics at analytics.google.com.
    2. In the Admin section, select an account and a property.
    3. Under Property, select Tracking Info>Tracking Code.
    4. In Jahia, open Page Composer, right-click on your site name and click Edit.
  2. In Google Analytics Site Settings>Google Analytics Site ID, enter your Tracking ID. You do not need to change the value in the Google Analytics cookie live time before expiration (seconds) field as the default value is set to 1 year (31536000 seconds).
  3. Save and publish the site.

Google begins to track and report on your web traffic. You can login to Google Analytics to verify that tracking is occurring.

Using Google Analytics for jExperience

The Google Analytics for jExperience module sends events to Google Analytics each time a personalization or an AB test variant displays on your site. This is helpful for digital marketers who want to see how many times each jExperience variant has displayed in Google Analytics.

If you have configured the first module, then this module doesn’t need any configuration. You just need to deploy it on your platform and activate it on your site.

To see events sent to Google Analytics:

  1. In Google Analytics, go to Real-time>Events. If there is live traffic on your website, you’ll see events display in the table under Events.
  2. You can view event category, action, and label information in the table for events sent from jExperience.
    • Event Category contains one of the following values: 
      • Personalization
        Indicates a content-level personalization
      • Optimization
        Indicates a content-level AB test
      • Page_personalization
        Indicates a page-level personalization
      • Page_optimization
        Indicates a page-level AB test
      • Event Action
        The field is automatically set to Display.
      • Event Label
        The field uses the following syntax:
        <title of the personalization or AB Test> - <title of variant>
      • Active Users
  3. To see the events labels, you need to filter on an event category:
  4. This example shows filtering with an AB Test:

    Which shows
  5. Here is an example of the HTTP call that is sent to the Google Analytics event API: