Download the ebook now

Thankyou for sharing the details. Here is your ebook on "Top questions people ask about Server Side Tagging".
Oops! Something went wrong while submitting the form.
Blog
GA4
Implementing a Recommended Event in Google Analytics 4
GA4

Implementing a Recommended Event in Google Analytics 4

By
4 min read
October 23, 2023

Out of the total websites in the world, more than 40% are built using WordPress. That’s a huge number for any CMS platform and hence, there is a great chance that your website is built using WordPress. Also, you probably use the WordPress Contact Form 7 plugin for your website's contact us form.

So tracking of WordPress contact form 7 is extremely important.

We will show two ways to track WordPress contact form 7

  • Traditional Google tag manager way that would take a lot of time.
  • and Tagmate way! ( No Code set up and fast way) 😲
Key Takeaways
  • Lorem ipsum
  • dolor sit
  • amet consectetur
  • Quam turpis pharetra
  • ut at cras non quis consectetur
  • sit cursusVel fermentum
  • posuere cras, diam est
  • nunc aliquet.

Tracking events is essential for gaining insights into how users interact with your website.


Implementing recommended events in GA4 is a relatively straightforward process, and it can provide you with valuable insights into how your users are interacting with your website or app. This information serves multiple purposes like improving your user experience, increasing conversions, and boosting your bottom line.


In this comprehensive guide contributed by Tagmate, we’ll walk through how to implement a recommended event in Google Analytics 4 (GA4) using Google Tag Manager:

What are Events and Why are They Important?

Events allow you to track actions taken by users beyond just pageviews. Any interaction you want to measure can be set up as an event in GA.


Common examples include:

  • Button clicks
  • Downloading files
  • Watching videos
  • Clicking links
  • Submitting forms
  • Adding items to a shopping cart
  • Making purchases


Without events, you only have pageviews to understand user behavior. But pageviews alone don’t provide the full picture.


Events give you granular data to answer critical questions like:

  • What content is resonating with users?
  • Where are users dropping off in a conversion funnel?
  • How effectively are calls-to-action driving actions?
  • What journey does a user take before converting?


Pageviews show you where users go. Events show you what they do.

This makes events invaluable for gaining actionable insights to optimize the user experience.

How Events Work in Google Analytics

Some basic events like pageviews and outbound link clicks are tracked automatically in GA.

But for other types of actions, you need to manually configure event tracking. This involves sending an event hit to Google Analytics by triggering a bit of code.


Here’s what a basic GA event hit contains:

  • Category - Typically the object or component involved
  • Action - The type of interaction
  • Label - Additional context (optional)
  • Value - A numeric value associated with the event (optional)


For example, a video play event could have:

  • Category = Videos
  • Action = Play
  • Label = Learn GA4 Video
  • Value = 0


When this event hits GA, it will show up in your reports with the category, action, label, and value specified.


Analytics will aggregate all events of that type to show metrics like total events, unique events, event value, etc.


Segmenting and filtering on these event dimensions allows you to dig into the data. This is how events unlock powerful insights into user behavior.

Implementing a Recommended Share Event

Now that we understand events, let’s walk through implementing one in GA4 using Google Tag Manager.


We’ll track a “Share” event on a social media share button click. Share is a recommended event type that comes predefined in GA.

Here are the steps:

  1. Identify the share button
  2. Create a GA4 event tag
  3. Add a click trigger
  4. Test in Preview mode
  5. Publish and confirm

Identifying the Share Button

First, we need to identify the specific button that triggers the share action.


Looking at the page source, we see the share button has this CSS class:

<button class="twitter-share-button">Share on Twitter</button>

We’ll use the twitter-share-button class to precisely target this button in Google Tag Manager.

Creating the GA4 Event Tag

Next, we’ll create a tag that fires the GA4 event on click.


In Google Tag Manager, create a new tag and select the GA4 Event tag type.


Configure the event tag as follows:


Name: GA4 Event Share Twitter

This name clearly identifies what the tag does.


Track Type: Event

Configuration: The GA4 configuration for your site

This specifies which GA4 property to send the event data to.


Event Name: Share

The Share event name comes predefined in GA4.


Event Parameters:

  • Name: Method
  • Value: Twitter


This adds context that the share was to Twitter specifically. The event parameters allow you to add details like this.


That covers the key configurations needed for the event tag.

Adding a Click Trigger

The tag alone won’t fire without a trigger attached. We need to specify when exactly the event should be sent to GA4.


Create a new Click trigger, configured as follows:


Name: Click - Twitter Share Button

Again, a clear descriptive name.


Trigger Type: Click - Just Links

This detects clicks on link elements specifically.


Fire On: Links that contain twitter-share-button

This precisely targets just the Twitter share button using the CSS class we identified.


Now the event tag will fire each time the intended share button is clicked.

Testing in Preview Mode

Before publishing the changes, it's critical to test and debug in GTM’s live Preview mode.


Preview mode lets you replicate the live tagging on your site to confirm everything works as expected before going fully live.


Follow these steps to test:

  1. Get the GTM preview URL
  2. Install the Tag Assistant browser extension
  3. Click the Twitter share button on your site
  4. Inspect if the GA4 event fired correctly


The tag assistant will show you all tag activity triggered as you interact with your page.

Verify that clicking the share button does indeed fire the GA4 Share event with the proper parameters.


Preview mode helps catch any mistakes so you can fix them before your changes impact data collection on your live site.

Publishing and Validating

Once Preview mode testing confirms the tagging is working properly, publish the changes in Google Tag Manager.


On your live site, click the Twitter share button again.


Go into Google Analytics Real Time reports and verify the Share event appears there with the proper Twitter method specified.


With that, you’ve successfully implemented the share event tracking!


Now your reports will contain useful metrics like:

  • Total social shares
  • Top shared pages
  • Share rates over time
  • Share performance by channel (Twitter, Facebook etc.)


This information can guide decisions around social strategy, content creation, and more.

Recap

Configuring events in Google Analytics 4 takes just a few steps:

  1. Identify the element associated with the event.
  2. Create a GA4 event tag to track it.
  3. Attach a trigger to fire the tag precisely when the event occurs.
  4. Thoroughly test in Preview mode.
  5. Publish the changes and confirm live data collection.


Following this straightforward process allows you to easily track any valuable user actions on your site.


Events are the foundation of understanding user behavior beyond simple pageviews. Leveraging events gives you granular data to optimize the customer experience and promote business growth.


Want to go beyond recommended events without worrying about coding?


Sign up for Tagmate now!

Frequently Asked Questions

Lorem ipsum dolor sit amet consectetur?

Lorem ipsum dolor sit amet consectetur. Viverra ut feugiat id ipsum morbi. A ipsum massa consequat ut urna vestibulum enim. Mauris id dignissim eu donec. Nibh urna eu nisl volutpat ut purus amet habitant fermentum.

Lorem ipsum dolor sit amet consectetur?

Lorem ipsum dolor sit amet consectetur. Sodales pellentesque enim sed dolor. Vel elementum ullamcorper adipiscing nec tristique. Egestas tellus amet praesent pulvinar quis.

Lorem ipsum dolor sit amet consectetur bibendum diam vel aliquet aliquam fringilla amet turpis varius srcu tincidunt potenti in ut amet ac aliquet donec volutpat ?

Lorem ipsum dolor sit amet consectetur. Aliquam diam magnis imperdiet pulvinar posuere. Pretium leo sed nunc morbi. In nibh risus purus ipsum amet. Leo sed laoreet orci faucibus. Ut lorem augue eget id venenatis odio tortor nec. Adipiscing bibendum tellus neque tortor.

Lorem ipsum dolor sit amet consectetur vel id viverra ultricies sed hendrerit et nulla?

Lorem ipsum dolor sit amet consectetur. Viverra ut feugiat id ipsum morbi. A ipsum massa consequat ut urna vestibulum enim. Mauris id dignissim eu donec. Nibh urna eu nisl volutpat ut purus amet habitant fermentum.

Lorem ipsum dolor sit amet consectetur bibendum diam vel aliquet?

Lorem ipsum dolor sit amet consectetur. Viverra ut feugiat id ipsum morbi. A ipsum massa consequat ut urna vestibulum enim. Mauris id dignissim eu donec. Nibh urna eu nisl volutpat ut purus amet habitant fermentum.

Subscribe to get our latest updates
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
eBook
Nunc lectus tempus dolor libero vulputate dui sed velit Augue enim malesuada
Download ebook
Subscribe to get our latest updates
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
eBook
Nunc lectus tempus dolor libero vulputate dui sed velit Augue enim malesuada
Download ebook
Subscribe to get our latest updates
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
eBook
Nunc lectus tempus dolor libero vulputate dui sed velit Augue enim malesuada
Download ebook
Subscribe to get our latest updates
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
eBook
Nunc lectus tempus dolor libero vulputate dui sed velit Augue enim malesuada
Download ebook
Subscribe to get our latest updates
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
eBook
Nunc lectus tempus dolor libero vulputate dui sed velit Augue enim malesuada
Download ebook
Subscribe to get our latest updates
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
eBook
Nunc lectus tempus dolor libero vulputate dui sed velit Augue enim malesuada
Download ebook
This is some text inside of a div block.

Heading

This is some text inside of a div block.
Google Analytics 4 Migration Via Tagmate

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C
Text link

Bold text

Emphasis

Superscript

Subscript

EBOOK
Top questions people ask about Server Side Tagging
Download for Free NOW!
Stay a step ahead.
Get served hottest tracking posts from industry-experts every week.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Ready to Get Started
Stay Updated
Subscribe to get the latest news, industry trends, blog posts, and updates.

Set up tags in seconds.
Not days.

Start Free Trial