Try our conversational search powered by Generative AI!

Manh Hung Nguyen
Apr 12, 2023
  1927
(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
Why C# Developers Should Embrace Node.js

Explore why C# developers should embrace Node.js especially with Optimizely's SaaS CMS on the horizon. Understand the shift towards agile web...

Andy Blyth | May 2, 2024 | Syndicated blog

Is Optimizely CMS PaaS the Preferred Choice?

As always, it depends. With it's comprehensive and proven support for complex business needs across various deployment scenarios, it fits very well...

Andy Blyth | May 2, 2024 | Syndicated blog

Adding market segment for Customized Commerce 14

Since v.14 of commerce, the old solution  for adding market segment to the url is not working anymore due to techinal changes of .NET Core. There i...

Oskar Zetterberg | May 2, 2024

Blazor components in Optimizely CMS admin/edit interface

Lab: Integrating Blazor Components into Various Aspects of Optimizely CMS admin/edit interface

Ove Lartelius | May 2, 2024 | Syndicated blog