---
updatedAt: 2026-08-12T16:25:16.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Sending eSputnik Widget Events to Google Analytics

Learn how to integrate your eSputnik forms with Google Analytics.

<HTMLBlock>{`
<p align="right" style="color: gray;">
  <a href="https://docs-ua.esputnik.com/docs/nadsilannya-podij-z-form-do-google-analytics" style="color: gray; text-decoration: none;"><em>
    Read this article in Ukrainian ⮕
  </em></a>
</p>
`}</HTMLBlock>

You can send the events data related to the interaction of users with your eSputnik widgets to your Google Analytics (GA) account.

eSputnik supports the <a rel="nofollow" href="https://support.google.com/analytics/answer/10269537?hl=en" target="_blank"> Universal Analytics</a> and Google Analytics 4 scripts for tracking events on your website.

> 🚧 Important
>
> It is recommended to install the Google Analytics 4 script, since the Google Universal Analytics property will stop processing data starting on July 1, 2023 (July 1, 2024, for Analytics 360 properties).

* [Setting up GA4 script for a website](https://docs.esputnik.com/docs/integrating-widgets-with-ga#setting-up-ga4-script-for-a-website) (directly into the website code).
* [Setting up GA4 with GTM](https://docs.esputnik.com/docs/integrating-widgets-with-ga#setting-up-ga4-in-gtm).

After that, you have to [enable exporting the widget event data to Google Analytics](https://docs.esputnik.com/docs/integrating-widgets-with-ga#enabling-widget-event-data-exporting-to-ga).

The entry point for events depends on the method you use to install the script:

* If there is GoogleAnalytics3 (`ga`), send into it.
* If there is `dataLayer` and there is `gtag` and dataLayer has at least one `G-\*` tag:
  1. Then call `gtag` with parameters (`send_to` is added) for each `tag id`.
  2. Otherwise, we write to `dataLayer`.

## Setting Up GA4 Script for a Website

To set up the Google Analytics GA4 script for a website:

1. In your GA account, select the **Admin** icon to open the GA settings.

<Image src="https://files.readme.io/9f970cd1d3ccf8a2d838e406b3542dd71a1139184026f10266e468918d0cfbd9-ga4-events-yespo-001.webp" align="center" width="80% "  alt="Google Analytics Admin page with the Admin icon highlighted in the left-hand side menu" />

2. Click **Create → Property**.

<Image src="https://files.readme.io/c535eba2b801019f18a4d3df2b9db306c47ea15dff12bec23249a7ddae6a9a6d-ga4-events-yespo-002.webp" align="center" width="80% "  alt="Google Analytics Admin page with the Create dropdown open and the Property option highlighted" />

3. In the **Property** setup, enter the **property name**, select the **country**, the **time zone** and the **currency**, then click **Next**.

<Image src="https://files.readme.io/597b025e289041471e1f95983aa6a31a444950f27db1c59b8ad776a3474f7e28-ga4-events-yespo-003.webp" align="center" width="80% "  alt="Create a property form with property name, time zone, and currency fields highlighted and the Next button highlighted" />

4. Describe your business  — indicate the industry category and company size.

<Image src="https://files.readme.io/5865debff53b3fcba5927bbf2dab5e1c6302952b6df2873d2610f37070227382-ga4-events-yespo-004.webp" align="center" width="80% "  alt="Describe your business form with industry category and business size fields highlighted and the Next button highlighted" />

5. Choose your business objectives and click **Create**.

<Image src="https://files.readme.io/cca73c9ffdfece54092c880934c03947c8396624f4a15cd6eecafe9807d48f21-ga4-events-yespo-005.webp" align="center" width="80% "  alt="Choose your business objectives step with the Sales option selected and the Create button highlighted" />

6. In your created property menu, select the **Web** platform.

<Image src="https://files.readme.io/93e3a994f7ef4c433b0df82ff1cf21e7e218a1a27b6f0a5b0572a3d072c9790d-ga4-events-yespo-006.webp" align="center" width="80% "  alt="Start collecting data step with the Web platform option highlighted" />

7. Enter the **website URL** and the **stream name** in the corresponding boxes, then click **Create & continue**.

<Image src="https://files.readme.io/7ba616cb0a471d94a26115892f1dbb472a7cf52aa4697f422533a989e9ad257c-ga4-events-yespo-007.webp" align="center" width="80% "  alt="Set up data stream window with Website URL and Stream name fields filled in and the Create and continue button highlighted" />

8. In the **Web stream details** menu, click the **copy** icon beside the **Measurement ID**.

<Image src="https://files.readme.io/b606a590106c08dc6d442f94714c75849b02a2f91870ebf1ee126e93db0bc394-ga4-events-yespo-008.webp" align="center" width="80% "  alt="Web stream details window with the copy icon next to the Measurement ID highlighted" />

9. Go to your site and insert the following code after the `<head>` tag, where substitute `MEASUREMENT_ID` with the one copied in the previous step.

```javascript
<!-- Google Analytics -->
   <!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id={MEASUREMENT_ID}"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', '{MEASUREMENT_ID}');
</script>
```

## Setting Up GA4 in GTM

Before proceeding to setting up GA4 in GTM, you have to:

1. Create a GTM account and a container following these <a rel="nofollow" href="https://support.google.com/tagmanager/answer/6103696" target="_blank">instructions</a>.

2. Follow the GTM <a rel="nofollow" href="https://developers.google.com/tag-platform/tag-manager/web?hl=en#standard_web_page_installation" target="_blank">standard web page installation</a> instructions.

To set up Google Analytics 4 (GA4) with Google Tag Manager (GTM):

1. Follow steps 1 to 6 described in [Setting up GA4 script for a website](https://docs.esputnik.com/docs/integrating-widgets-with-ga#setting-up-ga4-script-for-a-website)  section.
2. In Tag Manager, select **Tags** in the left-hand side menu and click **New** to create a new tag.

<Image src="https://files.readme.io/5113f8b934b3fa8e50ff3a14cff58d679bcc4911a995daf1088f04c48d35edf2-GA4-events-009.webp" align="center" width="80% " alt="Google Tag Manager Tags page with the Tags menu item and New button highlighted, showing no existing tags" />

3. Set the following tag configuration and triggering, then click **Save**:

* Select **Google Analytics: GA4 Event** as Tag Type.
* Use the measurement ID copied in step 7 of this [instruction](https://docs.esputnik.com/docs/integrating-widgets-with-ga).
* Select **All pages** for Firing Triggers.

<Image src="https://files.readme.io/31fb64f6e15be2e7adfb2f63456eff65b0cd29291a2ad2b1876f8eed5370dfdc-GA4-events-010.webp" align="center" width="80% " alt="Tag Configuration window with the Google Analytics GA4 Event tag type, Measurement ID, and All Pages firing trigger all highlighted" />

4. In the left-hand side menu, select **Triggers** and then **New** to create a new trigger.

<Image src="https://files.readme.io/17c2586faf0c36ca1caefee0b74f7de608d7c2727d830317e2a3e3ec7c7e2d21-GA4-events-011.webp" align="center" width="80% " alt="Google Tag Manager Triggers page with the Triggers menu item and New button highlighted, showing no existing triggers" />

5. In the slideout window, enter the trigger name and click the **Trigger Configuration** pane.

<Image src="https://files.readme.io/15489c9d27d1f2c3fa0ca98ee76d78e13f2c8ec7970c8cec06ad612c9b14ce3e-GA4-events-012.webp" align="center" width="80% " alt="Trigger configuration slideout with the trigger name field highlighted and the Custom Event trigger type highlighted in the Choose trigger type panel" />

6. Set the following configuration in the trigger configuration window:

* Select **Custom Event** as the trigger type.
* Enter **esputnik** as the event name.
* Select **All Custom Events** for the trigger to fire on.

<Image src="https://files.readme.io/3d6fa2aedd47d220433418d981a4072060092c093cfc4ca4e9a750a7378660e4-GA4-events-013.webp" align="center" width="80% " alt="Trigger Configuration panel with Custom Event type, the Event name field set to esputnik, and All Custom Events option highlighted" />

7. Go to **Variables** in the left-hand side menu, and select New in the User-Defined Variables pane.

<Image src="https://files.readme.io/a20da47f1ef5cd18ae959114cd530ae25a5df49e4448e29fdcf47acf7d21b72e-GA4-events-014.webp" align="center" width="80% " alt="Google Tag Manager Variables page with the Variables menu item and New button highlighted in the User-Defined Variables section" />

8. In the slide-out window, enter **configuration name** and click the **Variable Configuration** pane.

<Image src="https://files.readme.io/cb2f67ad4c68b1f64b015cd6e0be096d9e09ec9101eb1278d1ba7bec55aedbed-GA4-events-015.webp" align="center" width="80% " alt="Variable configuration slideout with the variable name field highlighted and the Data Layer Variable type highlighted in the Choose variable type panel" />

9. In the slide-out window, set the following parameters, then click **Save**:

* Variable Type
* Data Layer Variable Name
* Data Layer Version

<Image src="https://files.readme.io/9eb39ca7408b8d25ccf60a2fefc02514ff8acd15987d488d7f5fca21caaaf537-GA4-events-016.webp" align="center" width="80% " alt="Variable Configuration window with Data Layer Variable type, the Data Layer Variable Name set to eventAction, and Data Layer Version set to Version 2, all highlighted" />

You have to create the 3 variables with the following parameters:

| Variable Type       | Data Layer Variable Name | Data Layer Version |
| :------------------ | :----------------------- | :----------------- |
| Data Layer Variable | eventAction              | Version 2          |
| Data Layer Variable | eventCategory            | Version 2          |
| Data Layer Variable | eventLabel               | Version 2          |

10. Go to **Tags** in the left-hand side menu, and create a new tag with the following configuration, then click **Save**:

* Select **Google Analytics: GA4 Configuration** as Tag Type.
* Select the tag you created at step 3 in Configuration Tag.
* Enter **esputnik** as the event name.
* In Event Parameters, use the parameters and their values created in steps 8 and 9.
* In Firing Triggers, select **esputnik** event.

<Image src="https://files.readme.io/e055943c6eb7ec6eaf9e9d32834e331620fb66a3d83e83715cca87efb5856e32-GA4-events-017.webp" align="center" width="80% " alt="Tag Configuration window for a GA4 Event tag with the Event Name, Event Parameters, and Firing Trigger esputnik event all highlighted" />

9. Click **Submit** on the top panel.

<Image src="https://files.readme.io/18d53678326ae7653691f4649a379eaf0047417991e95e25b1933e0f483db6b7-GA4-events-018.webp" align="center" width="80% " alt="Google Tag Manager Tags list with the Submit button highlighted in the top toolbar" />

## Enabling Widget Event Data Exporting to GA

To enable the widget event data transfer:

1. In your eSputnik account, click **Site — Widgets**, and select the widget type in the left-hand side menu.

<Image src="https://files.readme.io/4a845f2bc4b5f141ab347a44d0cfb0abb42e3ab161ac67237044f63e6d083c40-image.png" alt="Analytics" align="center" width="80% " />

2. Select the widget, which events you want to export.
3. In the Widget Details menu, select **Integrations** and enable the **Export data to Google Analytics** slide button.

<Image src="https://files.readme.io/c86a4c4ba5beee5177a5c5dae0b17d19e603bcbc5e500bb27ae95367ec259b88-image.png" align="center" width="80% "  alt="Widget Integrations tab with the Export data to Google Analytics toggle enabled and highlighted" />

All the event data collected for that widget will be passed automatically to your GA account.

## Viewing the Real-time Analytics

To view the real-time analytics in your GA account: 

1. Select **Reports → Realtime** in the left-hand side menu.

<Image src="https://files.readme.io/038d9070bb6f0470f8d2bc8b987c069aa8a215ead65d8ec53f1d09d175255030-ga4-events-yespo-021.webp" align="center" width="80% "  alt="Google Analytics Realtime overview report with the Realtime menu item and Event count by Event name pane highlighted" />

2. In the Event count by Event name pane, Select **esputnik** in the Event name column.

The list of event parameters displays. Click them to see the events.

<Image src="https://files.readme.io/df4de2a8e15844a001af3d08d96f36ae91612599982fecedba19e9b26734502f-GA4-events-022.webp" align="center" width="40% " alt="Event count by Event name panel drilled into the esputnik event, with eventAction, eventCategory, and eventLabel parameters highlighted" />

The highlighted parameters are explained in the following table.

| Parameter     | Description                                                                                                                        |
| :------------ | :--------------------------------------------------------------------------------------------------------------------------------- |
| eventAction   | It contains the events as described in [Event categories and actions](https://docs.esputnik.com/docs/integrating-widgets-with-ga). |
| eventCategory | Widget type.                                                                                                                       |
| eventLable    | Widget ID.                                                                                                                         |

## Event Categories and Actions

GA displays eSputnik events in a table as shown below.

<Image src="https://files.readme.io/143cffc-small-image018.png" align="center" width="80% "  alt="Google Analytics table listing eSputnik events by Event Category and Event Action, showing BUILT_IN, DETACHED, and FLOATING_BOX categories with active user counts" />

The Event Category column contains the description of a widget/form type as described in the following table.

| Widget/form type | Description            |
| :--------------- | :--------------------- |
| BUILT\_IN        | Inline widget/form     |
| DETACHED         | Pop-ups                |
| FLOATING\_BOX    | Floating box, informer |
| LAUNCHER         | Launcher               |
| CONTENT\_LOCKER  | Content locker         |

The **Event Action** column in GA contains the action type made on a widget. The event actions are explained in the table below.

| Event Action               | Description                                                                                     |
| :------------------------- | :---------------------------------------------------------------------------------------------- |
| LauncherShow\_ web         | The launcher button displays on a website.                                                      |
| LauncherClick\_            | The launcher button clicked.                                                                    |
| FormShow\_bsit             | The form is displayed on a website.                                                             |
| FormClose\_.               | A site visitor closed the form.                                                                 |
| FormButtonClick\_on.       | A site visitor clicked the form button.                                                         |
| FormClick\_e wi            | A site visitor clicked anywhere within the form.                                                |
| FormStartFilling\_ for     | A site visitor started filling up the form.                                                     |
| FormFinish\_bscr           | A site visitor completed the subscription form (clicked “Subscribe”, no form validation errors) |
| FormSuccessSubscribe\_ess) | Form filling up status (subscription success)                                                   |
| FormAlreadySubscribe\_d)   | Form filling up status (already subscribed)                                                     |
| FormErrorSubscribe\_ror)   | Form filling up status (subscription error)                                                     |

The \[ID] part of the events for a specific widget sending its data to GA has the following structure: `f(form){id}v(variant){id}`, where `f(form){id}` is the form ID and `v(variant){id}` is the form variant ID.

For example, FormShow\_f781v781 in your GA table means that the form with the ID of 781, and the variant ID of 781 was displayed on a site.

The form ID is displayed in eSputnik, on the Widgets page in the ID column.

<Image src="https://files.readme.io/333b4e52981fc26f4369ad542f8b1694f56db32ee349ecdddb4afd23f395e4f1-image.png" align="center" width="80% "  alt="Widgets page listing three widgets with the ID column highlighted" />

## Comparing Widget Clicks with GA4 Sessions

<Callout icon="📘" theme="info">
  ### Note

  Google Analytics 4 does not track clicks on the widget's Close (X) button — it only records a session or pageview when a visitor actually navigates via a UTM-tagged link inside the widget. eSputnik's own widget statistics count Close button clicks in addition to link-navigation clicks, so your widget's click count can be higher than the GA4 session count for the same widget.
</Callout>

<br />