# 2. GA4 Custom Events & Definitions

## Custom Events in GA4 Admin Dashboard

Navigate to your Admin panel in Google Analytics, select the account and property you want to use when collecting widget events and data, then click the **"EVENTS"** tab.

<figure><img src="https://2949826416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mh0SIdnTfBpdN11l3wk%2Fuploads%2F4kktIBhpIzoc6JDPimFF%2FXnip2023-04-24_14-47-38.jpg?alt=media&#x26;token=4f616c3b-c667-4f6d-aa05-55bead862dc0" alt=""><figcaption></figcaption></figure>

In the **"EVENTS"** tab you will see all current custom events that are being recorded in your GA4 property. You will also be able to create new custom events, which is what we are going to do to collect data from the Engagement Widgets. Click the **"Create Event"** button as shown in the screenshot below to start creating new GA4 events.

<figure><img src="https://2949826416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mh0SIdnTfBpdN11l3wk%2Fuploads%2FCRGZcwLu8EKlGPzFGiaK%2FXnip2023-04-24_14-48-21.jpg?alt=media&#x26;token=0c8cd7c5-fcc2-4b0f-8703-6ec754fa117e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Follow the configuration instructions below to setup your custom Engagement Widget GA4 events:**
{% endhint %}

<figure><img src="https://2949826416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mh0SIdnTfBpdN11l3wk%2Fuploads%2FiYJ70RrTJ9NDHJ6xz0Ge%2FXnip2023-04-21_12-28-53.jpg?alt=media&#x26;token=490cf0a7-10f4-43a8-ac9c-accb10487fd2" alt=""><figcaption></figcaption></figure>

**Custom Event Name -** We name the events the same as the Event Values, but you can name the events however you want.

**Matching conditions -** Create a custom event when another event matches ALL of the following conditions:

1. **Parameter:** event\_name
2. **Operator:** equals
3. **Event Values: (copy exactly as seen below)**
   * widget\_opened
   * widget\_closed
   * tool\_opened
   * tool\_closed
   * welcome\_message\_clicked
   * welcome\_message\_closed
   * all\_welcome\_messages\_closed

**Parameter configuration -** Copy parameters from the source event (make sure this is checked)

## GA4 Custom Definitions for Custom Events

Next you will need to create **"Custom Definitions"** for your newly created GA4 custom events. In your Admin panel in Google Analytics, make sure you're in the same account and property you just created your custom events in, and then select the **"Custom Definitions"** tab.

<figure><img src="https://2949826416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mh0SIdnTfBpdN11l3wk%2Fuploads%2FILsc9YCdk8N7C9gegQZP%2FXnip2023-04-24_14-53-53.jpg?alt=media&#x26;token=68888afe-227f-4cfc-b01e-8393b3d404d0" alt=""><figcaption></figcaption></figure>

In this tab, you will see all current custom definitions for custom events that are being recorded in your GA4 property. You will also be able to create new custom definitions, which help GA4 identify and categorize your custom events by adding additional data to each event. Click the **"Create Custom Definition"** button as shown in the screenshot below to start creating new custom definitions for GA4 events.

<figure><img src="https://2949826416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mh0SIdnTfBpdN11l3wk%2Fuploads%2F4NF2bOTKbeYZjZ3nEA01%2FXnip2023-04-24_14-54-31.jpg?alt=media&#x26;token=5ed76cba-941b-4f3c-94bd-7b27a6649927" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Follow the configuration instructions below to setup your custom definitions for your GA4 events:**
{% endhint %}

<figure><img src="https://2949826416-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mh0SIdnTfBpdN11l3wk%2Fuploads%2FFDECiy9PwWdrM9E2A1b0%2FXnip2023-04-21_12-29-18.jpg?alt=media&#x26;token=23582e77-3926-4dc6-a01d-7114338ee01e" alt=""><figcaption></figcaption></figure>

#### Custom Definitions for Each Widget Event: **(copy exactly as seen below)**

* **Dimension Name -** *Widget Opened*\
  **Description -** *Engagement Widget Opened*\
  **Scope -** *Event*\
  **User Property/Parameter -** *widget\_opened*<br>
* **Dimension Name -** *Widget Closed*\
  **Description -** *Engagement Widget Closed*\
  **Scope -** *Event*\
  **User Property/Parameter -** *widget\_closed*<br>
* **Dimension Name -** *Tool Opened*\
  **Description -** *Engagement tool was opened*\
  **Scope -** *Event*\
  **User Property/Parameter -** *tool\_opened*<br>
* **Dimension Name -** *Tool Closed*\
  **Description -** *Engagement Widget Tool Closed*\
  **Scope -** *Event*\
  **User Property/Parameter -** *tool\_closed*<br>
* **Dimension Name -** *Welcome Message Clicked*\
  **Description -** *Visitor clicked a video or engagement tool inside a welcome message*\
  **Scope -** *Event*\
  **User Property/Parameter -** *welcome\_message\_clicked*<br>
* **Dimension Name -** *Welcome Message Closed*\
  **Description -** *Single welcome message was closed during a session*\
  **Scope -** *Event*\
  **User Property/Parameter -** *welcome\_message\_closed*<br>
* **Dimension Name -** *All Welcome Messages Closed*\
  **Description -** *All active welcome messages were closed during a single session*\
  **Scope -** *Event*\
  **User Property/Parameter -** *all\_welcome\_messages\_closed*
