Google Analytics Featured Image

Web analytics involves gathering and analysis of a website’s traffic to gain insights, that help you make effective and timely decisions. Google Analytics has been the most widely used analytics tool. Now in its next iteration, Google Analytics 4 (GA4) brings a new paradigm for tracking page views and events. 

GA4 is the next generation of analytics, a new marketing tool, that is designed for the future of measuring insights across data streams. It focuses on understanding the user or customer journey to help you make focussed, and future-ready marketing strategies.

Universal Analytics (UA) will cease processing new hits from July 1, 2023. Google developed a new web analytics model to track visits and events through GA4, and it will not be compatible with its predecessors, as this quote from Google Analytics documentation suggests.

“On July 1, 2023, standard Universal Analytics properties will stop processing new hits. If you still rely on Universal Analytics, we recommend that you prepare to use Google Analytics 4 going forward.”

For websites, GA4 requires a new property to be set up from scratch, and using it could pose challenges. In order to ensure a smooth transition to GA4, we have some tips about Moving to Google Analytics 4

Unlike session-oriented analytics of UA, GA4 is built around ‘Events’ for user journeys. GA4 combines both web and mobile traffic analytics with a device-agnostic model. Consequently, GA4 does away with third-party cookies and addresses data privacy concerns worldwide.

The game-changing model of GA4

The basic difference between UA and GA4 events tracking is well-explained in the image below.

GA Events compared
Source: Google

Tracking events from form submissions is an important metric for most websites. The general structure of a form submission event trigger in UA contains: 

  • Event Action
  • Event Category
  • Event Label
  • Custom Dimensions
  • Custom Metric

Whereas in GA4, the form submission event trigger will contain:

  • Event Name, which is more like a variable name to track events by.
  • Key-Value pair of parameters under the event name variable.

As an example, for a button click on a web page, we can define a “Magic Button Click” event, that contains the following parameters to capture and send into GA4. The event would look like this:

	'link_url' : '{{Click Url}}',
	'link_text' : '{{Click Url}}'

Setting up GA4 involves three major stages – Property Setup, Events Setup, and Events Migration from UA to GA4.

Different ways for GA4 Property Setup

The standard process of setting it up involves visiting the Google Analytics Website and creating a new GA4 Property under the same analytics account as that of UA. Alternatively, there’s also an option of Setup Assistant for creating a new GA4 Property using a wizard.

On the WordPress platform, there are several options or plugins available to automatically set up and place GA4 tags on your websites.

Manual GA4 Property Setup

You always have the option to set up GA4 and UA IDs manually. Refer to the Google Analytics documentation, which describes the switch to GA4.

Next, create a GA4 Property under the same Universal Analytics account and select data streams. The Setup Assistant could be utilized to create the GA4 Property.

Finally, get the GA4 tag code from the newly created GA4 Property. For example, it would appear somewhat like the following screenshot. Notice the Measurement ID: G-XXXXXXXXXXX

Web stream details

Automated GA4 Property Setup

Note that some plugins may not include an account creation feature. In such a scenario, you need to execute the manual process for account creation and thereafter use the plugins for tagging purposes.

Site Kit by Google

Google Site Kit is meant to provide a hassle-free experience for GA4 Setup. It can facilitate both, the creation of an account and a new GA4 Property. Setting it up is rather straightforward.

Install and activate the Site Kit plugin. Navigate to Site Kit > Dashboard and click the prompt to Set Up Google Analytics. Approve the connection to your Google account. Refer to this tutorial on setting up a GA4 Property with the Site Kit plugin.


The MonsterInsights plugin supports a dual tracking feature and both UA and GA4 IDs could be set up in the plugin settings. Refer to its documentation for further details about GA4 Setup.

Google Tag Manager

For using Google Tag Manager (GTM), you need to provide its configuration and add the tag by entering the measurement ID. Next, you can create the triggers & tags as needed and also add the values.

Thereafter, publish the tags you want to execute and collect or track events with them. You can create a new configuration tag for GA4 from GTM that would act as the page views count. It can support other events as well. Refer to the GTM documentation to know more.

GA4 Events Setup

Events can be imported using two methods. If you create a new GA4 Property using the Setup Assistant, events can be imported from UA as it is linked with GA4 automatically.

Right now, it is recommended to send events to both UA and GA4. This way, web analysts get an opportunity to become familiar with GA4. Once UA ceases to process data, your team would have gained good enough experience with GA4 data streams’ traffic analysis, and events reporting. 

Events Migration

You can migrate the events using different paths available to you, depending on specific cases. The goals, conversions, and events in UA are all treated as events in GA4. You could also mark a particular event as a conversion for tracking in GA4. However, note that there is a limit on the total number of events and conversions you can configure in GA4.

Automated Events Import from UA

GA4 provides an option to import eligible events from UA. Default events, or events with standard configurations (but not custom events), can be automatically migrated to GA4. Let’s look at some use cases of automated events in GA4, as provided in the documentation.

GA4 Property Settings

In the screenshot above, you can see the ‘Import from Universal Analytics’ option in the ‘Set up conversions’ item under Property settings. 

A list of events and destinations/goals appears when you click the ‘Import from Universal Analytics’ option, as shown in the screenshot below. The list is categorized by Destination (Goals) and Event. You need to select from these and click the ‘Import selected conversions’.

GA4 Connection

A prompt is displayed, informing you that you need to set up a new GA4 ID to make it work.

Not relieving events from GA4

Manual Events Import from UA

In case, if you are migrating events manually, you need to decide on different methods, such as via custom code, or Google Tag Manager, among other methods.

It is recommended to use GA4 with GTM, enabling a smooth set-up with data layer variables. In GTM tag types, you can now notice the new, GA4 configuration tag, and GA4 event tag.

Custom Events using GTM

For such a case, keep a tag or event ready that you want to launch using the GTM. Let’s assume you would like to fire up a custom event to be tracked on a specific button click. Create a custom trigger in GTM to execute.

Here’s an example of an event we created in GTM for

Button Click

As you can see in the preceding screenshot, we used a GA4 Event Tag type to fire the event on a ‘Single Case Study Link’ trigger. The ‘Single Case Study Link’ is a normal ‘Just Links’ trigger, with conditions applied as shown below.

For reference, read about more trigger types in GTM.

Trigger Configuration

You can save changes and debug them using the GTM Preview option. 


The GTM Preview option opens a window to set the URL in the text field and executes a debug or preview mode to test your changes in GTM.

Connect Tag

Clicking on continue opens the website, and you can perform the user actions required to trigger the created events. GTM Preview shows the count of events occurring on every web page. Refer to this tutorial about GTM Debugging.

Custom Events using code snippets

Implementing custom events in GA4 requires you to add a script in the head section of every web page to track the events (Here, replace the web-stream-ga4-id with the actual ID of your account).

A head script looks like this: 

<!-- Google tag (gtag.js) -->
<script async src="{web-stream-ga4-id}"></script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '{web-stream-ga4-id}');

The following code snippet shows how you can fire a custom event in GA4 on a specific JavaScript event, such as on a button click, among other events.

 'key1': 'value1',
 'key2': 'value2',
 'key3': 'value3',

Though, be aware of some limitations in GA4 for custom parameters and their length.

  • The ‘event_name’ should be less than or equal to 40 characters.
  • The ‘total key:value’ parameter should not exceed 25 characters.
  • The ‘length of key’ should be less than or equal to 40 characters.
  • The ‘length of value’ should be less than or equal to 100 characters.
  • A total of 500 new events would be counted per user & per day. Any additional events won’t be logged. You have the option to archive the events.

Read more about GA4 event collection limits.

Whether you go for automated or manual events’ migration to GA4, plan ahead with a unified naming convention for events. Also, refer to this good resource for GA4 migration.

AMP support for GA4 analytics

GA4 has got AMP support as well, install this AMP Google Analytics 4 Support Plugin on your WordPress website, and in the settings, set it up with your GA4 ID.


Migration to GA4 marks a tectonic shift in terms of analytics. You need a fresh perspective for getting better insights from data streams as a unified event-tracking mechanism. A significant part of the modern web runs on the WordPress platform, and GA4 along with GTM enables you to perform the necessary analytics. If you have any queries regarding migrating to GA4, drop a line in the comments, or start a conversation with us here.

Links: Get in Touch | Our Work