Try our conversational search powered by Generative AI!

Manh Hung Nguyen
Apr 12, 2023
  1938
(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
IP block for edit and admin in DXP

Why IP-blocking edit/admin? A hacker can try to guess user names and passwords to gain access to your site. This risk can be minimized in a couple ...

Daniel Ovaska | May 15, 2024

Do not upgrade to EPiServer.CMS.Core 12.21.4 without reading this!

Todays update of EPiServer.CMS.Core 12.21.4 alters default sort order in an unexpected way, when you are working with muligple languages and have...

Tomas Hensrud Gulla | May 14, 2024 | Syndicated blog

Upgrade Optimizely CMS From v11 to v12

Why Upgrade? There are many improvements implemented in version 12, but most importantly is that the whole framework is migrated from .Net Framewor...

MilosR | May 13, 2024

Configured Commerce - Infrastructure Updates Ahoy!

I'm very happy to share an important milestone - we no longer have any customers in our legacy v1 environment!  This means that the Configured...

John McCarroll | May 10, 2024