How to use Google Analytics 4 Event Builder

Table of contents for how to use Google Analytics 4 Event Builder

  1. Introduction to Google Analytics 4 Event Builder
  2. When do we use Google Analytics 4 Event Builder?
  3. Overview of the Google Analytics 4 Event Builder Tool
  4. Steps to generate api_secret and measurement ID in a Google Analytics 4 property
  5. Steps to create Firebase APP ID in Firebase Console
  6. How to create an event and send it to a Google Analytics 4 property
  7. How to validate events in a Google Analytics 4 property

Introduction to Google Analytics 4 Event Builder

Google Analytics 4 Event Builder is a tool that allows users to create offline measurement protocol events and send this data to a Google Analytics 4 property.

So, let us understand what exactly measurement protocol events are and when to use them. 

Using the Event Builder tool you can send data to a Google Analytics 4 property from your own servers that are not part of HTML or other offline POS machines. 

In the case of general analytics set up, Google Analytics tracking code is placed on every single page. When a user visits the page, it tracks the user journey with basic GA4 metrics (page view, bounce rate, user type, etc), whereas measurement protocol lets developers create HTTP post data requests and send this information to Google Analytics 4 servers. This way you can also track the user journey outside your website.

Now that we have understood the basics of Google Analytics 4 Event Builder, let’s see when to use this tool.

 
Get the E-Book (50 Pages)
 
Get the FREE E-Book (50+ Pages)

When do we use Google Analytics 4 Event Builder?

The GA4 Event Builder tool should be used when you have data that is offline and you want to send this data to Google Analytics. 

Let’s take an example; you are a business owner for a retail company which is available both online and offline. You would like to understand the overall performance of the business. To do so, both online and offline sales should be considered. 

In this case, you can use the Event Builder to send offline data to a Google Analytics 4 property. Now, that you have both online and offline data in Google Analytics, performance can easily be measured.

Overview of the GA4 Event Builder tool

Click on the following link to access the GA4 Event Builder tool: GA4 Event Builder

This tool consists of 2 main sections:

  1. Hit summary
  2. Event details

#1 Hit summary

This box displays the full event and validation status. Once you login into the tool, you will notice the image as shown below:

To send events to Google Analytics, an HTTP Post request should be made to the below endpoint.

POST /mp/collect HTTP/1.1
HOST: www.google-analytics.com

<payload_data>

In hit summary, you have controls as shown below and these details need to be provided for creating the events.

API secret: This is the required query parameter, which is generated using Google Analytics 4 UI. Follow the below steps to create an API secret key.

Note: you would need to create a Google Analytics 4 property in order to create an API secret key and measurement ID.

You can also upgrade an existing GA Property to a GA4 property.

Steps to generate api_secret and measurement ID in a Google Analytics 4 property.

Step-1: Log in to your Google Analytics 4 property and then click on the ‘Admin’ link on the bottom left-hand side.

Step-2: Under the ‘Property’ column, click on ‘Data Streams’.

Step-3: Once you click on the data streams option from the property column, you will screen like below. You have an option to create a data stream for IOS, Android, and Web.

Step-4: Let’s create a web data stream for this example. Click on ‘Web’ to set up the data stream as shown below

Step-5: Provide a website URL and stream name to set up your web stream.

Step-6: Once the website URL and data stream name is provided, you will notice that the ‘Create stream’ button is highlighted. Click on ‘Create stream’.

Step-7: You will see a screen like the one below once the stream is created. This is where the measurement ID is created.

Step-8: To create an API secret key, scroll down and click on the ‘Measurement protocol API secrets’ in ‘Additional settings’.

Step-9: A new pop up will open when you click on ‘Measurement protocol API secrets’, you will see a ‘Create’ button as shown below:

Step-10: When you click on ‘Create’, you are asked to provide a nickname for the API secret.

Step-11: For example, let us give ‘offline data’ as a nickname for the API secret key and click on ‘Create’.

Step-12: A secret value is created which is used as a key to send the events using measurement protocol.

Steps to create Firebase APP ID in Firebase console

This is one of the required parameters which is an identifier for the Firebase app. This value is found in the Firebase console.

Step-1: Login to your Firebase console and click on ‘Project overview’ on the left hand side.

Step-2: Click on the gear icon and select ‘Project settings’ as shown in the image below.

Step-3: You will now land on the ‘General’ tab in the selected project settings.

Step-4: Scroll down and you will notice the ‘Your apps’ section.

Step-5: As an example, let us select the web app to add to our project.

Step-6: You will see a form as shown below to add Firebase to your web app.

Step-7: Enter a nickname and click on ‘Register app’.

Note that you can also set up Firebase hosting which is free to get started.

Step-8: After registration is complete, an SDK will be created which has Firebase configuration information along with the app ID and measurement ID.

We have successfully created a measurement ID and an API secret key. 

Let’s have a look at the other controls that are needed for creating an event in Event builder.

#Client ID: It is a required string-type query parameter, which uniquely identifies a user instance on the web.

#User ID: It is an optional query parameter, which is used to identify a user. User ID may include only UTF-8 characters.

# app_instance_id: This is one of the required parameters which uniquely identifies a specific installation of a Firebase app. 

#timestamp_micros: It is an optional parameter This value should be in microseconds, not microseconds. This is the timestamp associated with the event.

#Category: Based on the type of event you want to send to your GA4 property,you can select from the drop-down as shown below.

#Name: Based on the category you select, you will see options to select for the name. For example, if you have selected the category as retail the you would see below options for the name.

#2 Event Details:

Step-1: Based on the category and name you select in the HIT summary section, you will see event parameters get populated automatically where values need to be filled by the user.

For example, if I select the category as Retail/Ecommerce and .ame as view_item, as shown below:

Step-2: You will see event parameters created, as shown below. Provide the values in the fields for item_id and item_location.

Step-3: You have an option to select the event details type from the drop-down, as shown below. For example, if we are adding item ID, we can select number, since item ID is a numeric value.

Step-4: You can add additional parameters by clicking on the parameter button as shown below:

How to create an event and send it to a Google Analytics 4 property

Now that we have understood the tool and it’s various controls, let’s go ahead and create a test event and validate it.

Step-1: Copy the measurement ID and API secret which we created and update the fields mentioned, as below:

Note: I have selected ‘Retail/Ecommerce’ as the category and the name is ‘view_item’

Step-2:  Provide details in the event details section. In our example, I have used item_id

Step-3: Based on the values, the event payload is automatically created as shown below:

Step-4: Click on the ‘Validate event’ button which is highlighted after the event payload is created by the tool

Step-5: If the event is valid, you will see the status highlighted in green above the event payload as shown below:

Step-6: After the validation is completed, you will find the option to send the event to Google Analytics, as shown below:

Below is the example event payload, which we have created:

{“clientId”:”12121212.3434″,”nonPersonalizedAds”:false,”events”:[{“name”:”view_item”,”params”:{“item_id”:”1213133″}}],”userProperties”:{“name”:{“value”:”tutorial”}}}

Step-7: Click on ‘Send event to Google Analytics’ to validate the data in reports.

How to validate events in Google Analytics 4 property

To validate the data sent from the Event Builder Tool in the GA4 property, follow the below steps:

Step-1: Log in to your GA4 property and make sure you select the right property under which you have created the data stream for measurement ID.

Step-2: Click on the ‘Real-time’ reports tab on the left-hand side.

Step-3: Check for the data sent in the ‘Event count’ according to the name in the ‘Event name’ section.

Congratulations!!! You have now successfully created an event using the GA4 Event Builder and validated the data in the real-time reports.

Other articles related to GA4 (Google Analytics 4)

#1 GA4 Intro

  1. What is GA4 (Google Analytics 4) – The Apps + Web Property?
  2. Key Benefits of Using Google Analytics 4 (GA4)
  3. How to upgrade to GA4 (Google Analytics 4)
  4. Google Analytics 4 (GA4) vs Universal Analytics – What is the difference?
  5. Google Signals GA4 – See demographics (gender, age) in Google Analytics 4
  6. Understanding Google Analytics Measurement ID (GA4)
  7. Google Analytics 4 training and tutorial
  8. Using the GA4 test property

#2 GA4 Integration

  1. How to connect GA4 (Google Analytics 4) with Google Data Studio
  2. How to link GA4 (Google Analytics 4) with Google Ads
  3. GA4 BigQuery – Connect Google Analytics 4 with BigQuery

#3 GA4 Events

  1. GA4 (Google Analytics 4) Event Tracking Setup Tutorial
  2. How to set up GA4 Custom Events via Google Tag Manager
  3. GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
  4. Events Report in Google Analytics 4 (GA4)
  5. GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
  6. Event Scoped Custom Dimensions in GA4 – Tutorial

#4 GA4 Conversions

  1. GA4 (Google Analytics 4) Conversion Tracking Guide
  2. How to import conversions from GA4 property to your Google Ads account

#5 GA4 Dimensions and Metrics

  1. GA4 Metrics Tutorial with Free Google Analytics 4 Ebook
  2. GA4 Custom Metrics Tutorial
  3. GA4 Dimensions Tutorial
  4. GA4 Custom Dimensions Tutorial

#6 GA4 Ecommerce

  1. GA4 (Google Analytics 4) Ecommerce Tracking via GTM – Tutorial

#7 GA4 Specialized Tracking

  1. Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
  2. GA4 Site Search – Tracking Site Search in Google Analytics 4
  3. GA4 (Google Analytics 4) Scroll Tracking Tutorial
  4. How to Install Google Analytics 4 on Shopify
  5. Self-referral Google Analytics 4 – Referral exclusion GA4
  6. GA4 Data Import Tutorial

#8 GA4 filters

  1. GA4 filters – Understanding data filters in Google Analytics 4
  2. How to create and test filters in Google Analytics 4 (GA4)?
  3. Exclude internal traffic in GA4 (Google Analytics 4) via IP filter

#9 GA4 Analysis Hub

  1. Analysis Hub Google Analytics – Exploration Report in GA4 (Google Analytics 4)
  2. How to use the user lifetime report in Google Analytics 4 (GA4)
  3. How to use path analysis report in Google Analytics 4 (GA4)
  4. How to use Segment Overlap Report in Google Analytics 4 (GA4)
  5. How to use the Funnel Analysis Report in Google Analytics 4 (GA4)

#10 GA4 Advanced

  1. How to use Debug View report in Google Analytics 4 (GA4)
  2. Understanding GA4 measurement protocol
  3. How to create a remarketing audience in Google Analytics 4 (GA4)
  4. GA4 Audiences – Creating custom audience in Google Analytics 4
  5. How to build comparison (Advanced segment) in Google Analytics 4 (GA4)

#11 GA4 Reporting

  1. How to create custom insights in Google Analytics 4 (GA4)

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade
error: Alert: Content is protected !!