Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Manh Hung Nguyen
Apr 12, 2023
  1911
(2 votes)

EPiServer.GoogleAnalytics now support Google Analytics GA4

As you know Google Analytics 4 is replacing Universal Analytics. On July 1, 2023, your Universal Analytics properties will stop collecting data. Only GA4 properties will collect data after July 1.

We have just released the latest version of the EPiServer.GoogleAnalytics package, version 4.0, in which you can now display GA4 analytics data on your site. And note that with this version 4.0, you will only be able to use it with a Google Analytics account that has already added the GA4 property. Instructions for migrating data from Universal Analytics to Google Analytics 4 can be found here.

Installation

* Install from Optimizely nuget

Setting up tracking script

* Add MeasurementId:

Step 1: Get your MeasurementId:

Go to Google Analytics > Admin > Data Streams > Web stream details > Stream details > Copy MEASUREMENT ID

Step 2: Add your MeasurementId to your site:

Go to Edit Mode > Addons > GoogleAnalytics > Admin > Configure Tracking > All Sites > Select Google Analytics 4 > Paste MEASUREMENT ID

* Custom Tracking Script:

Go to Edit Mode > Addons > GoogleAnalytics > Admin > Configure Tracking > All Sites > Select Custom Tracking Script > Paste this code with your MeasurementId:

Enable debug mode

To monitor events from your website as Analytics collects them in DebugView of Google Analytics, add this code in Startup.cs

For more details about the configuration, you can refer to our online documentation

Apr 12, 2023

Comments

Please login to comment.
Latest blogs
Optimizely Unit Testing Using CmsContentScaffolding Package

Introduction Unit tests shouldn't be created just for business logic, but also for the content and rules defined for content creation (available...

MilosR | Apr 26, 2024

Solving the mystery of high memory usage

Sometimes, my work is easy, the problem could be resolved with one look (when I’m lucky enough to look at where it needs to be looked, just like th...

Quan Mai | Apr 22, 2024 | Syndicated blog

Search & Navigation reporting improvements

From version 16.1.0 there are some updates on the statistics pages: Add pagination to search phrase list Allows choosing a custom date range to get...

Phong | Apr 22, 2024

Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog