Google Analytics 4 for legacy Video Portal


About

Google Analytics 4 (GA4) lets you measure traffic and engagement in your Content Hubs or legacy Video Portal site. This article explains how to connect your site to GA4 and validate that GA4 is collecting data.

To send player events to GA4, you also need to configure Google Analytics in the player. See Integration settings in the player.

Before you start

Make sure you have a Google Analytics account with a GA4 property and a web data stream for your site. A web data stream represents your site in GA4 and is associated with your site URL.

If you need to create a GA4 property or web data stream, see Set up Analytics for a website and/or app.

Configure GA4 for your site

Configure the web data stream

  1. Sign in to your Google Analytics account.
  2. Click Admin in the lower-left corner.
  3. Make sure the GA4 property for your Content Hub or legacy Video Portal is selected at the top of the page.
  4. Under Data collection and modification, click Data streams.
  5. Select the web data stream for your site.
  6. Under Google tag, click View tag instructions.
  7. Under Install manually, copy the Google tag.

    The Google tag contains an external JavaScript URL and JavaScript configuration code. You'll add these to separate fields in your site configuration.

Configure the Google tag in your site

  1. Go to the Configuration Management console.
  2. Open the Application module.
  3. In the headerJSlinks field, add the URL from the src attribute of the first <script> element. For example:
    https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX
  4. In the headerJS field, add the JavaScript from inside the second <script> element. Don't include the opening and closing <script> tags. For example:
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    
    gtag('config', 'G-XXXXXXXXXX');

    Replace G-XXXXXXXXXX with the Measurement ID from your Google tag.

  5. Confirm that the configuration looks similar to the following:

    Google tag configured in the headerJSlinks and headerJS fields in the Application module.

  6. Click Save.

Validate the setup

  1. Open your Content Hub or legacy Video Portal and navigate through a few pages.
  2. Return to Google Analytics.
  3. Click Admin in the lower-left corner.
  4. Make sure the GA4 property for your site is selected at the top of the page.
  5. Under Data collection and modification, click Data streams.
  6. Select the web data stream for your site.
  7. Under Google tag, click View tag instructions.
  8. Click Test installation.
  9. Google Analytics confirms when the Google tag is detected on your site.
  10. Close the installation instructions and click Reports in the left panel.
  11. Click Realtime overview and confirm that activity from your site appears.
  12. Click Realtime pages.
  13. Navigate between several pages in your site without refreshing your browser.
  14. Confirm that the different page paths appear in the report. This verifies that GA4 is tracking client-side navigation in your site.

Track events

Automatically collected events

GA4 automatically collects events that provide information about how visitors interact with your site. These can include events such as page_view, session_start, user_engagement, and scroll.

Some events are collected automatically, while others depend on the Enhanced Measurement settings configured for your web data stream.

To learn more, see Automatically collected events.

Custom events

Before you create a custom event, check whether GA4 already collects the event automatically or provides a recommended event for the interaction you want to track.

For more information, see:

You can implement custom events using different methods, depending on your Google Analytics configuration. For website measurement, see:

For help tracking Content Hub or legacy Video Portal interactions that aren't collected automatically by GA4, contact your Kaltura representative.

Was this article helpful?
Thank you for your feedback!
User Icon

Thank you! Your comment has been submitted.

In this article
Related articles