Sending eSputnik Widget Events to Google Analytics

Learn how to integrate your eSputnik forms with Google Analytics.

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 Universal Analytics 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).

After that, you have to enable exporting the widget event data to Google Analytics.

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.
Google Analytics Admin page with the Admin icon highlighted in the left-hand side menu
  1. Click Create → Property.
Google Analytics Admin page with the Create dropdown open and the Property option highlighted
  1. In the Property setup, enter the property name, select the country, the time zone and the currency, then click Next.
Create a property form with property name, time zone, and currency fields highlighted and the Next button highlighted
  1. DescribeĀ your businessĀ  — indicate the industry category and company size.
Describe your business form with industry category and business size fields highlighted and the Next button highlighted
  1. Choose yourĀ business objectivesĀ and click Create.
Choose your business objectives step with the Sales option selected and the Create button highlighted
  1. In your created property menu, select the WebĀ platform.
Start collecting data step with the Web platform option highlighted
  1. Enter the website URL and the stream name in the corresponding boxes, then click Create &Ā continue.
Set up data stream window with Website URL and Stream name fields filled in and the Create and continue button highlighted
  1. In the Web stream details menu, click the copy icon beside the Measurement ID.
Web stream details window with the copy icon next to the Measurement ID highlighted
  1. 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.
<!-- 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 instructions.

  2. Follow the GTM standard web page installation 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 section.
  2. In Tag Manager, select Tags in the left-hand side menu and click New to create a new tag.
Google Tag Manager Tags page with the Tags menu item and New button highlighted, showing no existing tags
  1. 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.
  • Select All pages for Firing Triggers.
Tag Configuration window with the Google Analytics GA4 Event tag type, Measurement ID, and All Pages firing trigger all highlighted
  1. In the left-hand side menu, select Triggers and then New to create a new trigger.
Google Tag Manager Triggers page with the Triggers menu item and New button highlighted, showing no existing triggers
  1. In the slideout window, enter the trigger name and click the Trigger Configuration pane.
Trigger configuration slideout with the trigger name field highlighted and the Custom Event trigger type highlighted in the Choose trigger type panel
  1. 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.
Trigger Configuration panel with Custom Event type, the Event name field set to esputnik, and All Custom Events option highlighted
  1. Go to Variables in the left-hand side menu, and select New in the User-Defined Variables pane.
Google Tag Manager Variables page with the Variables menu item and New button highlighted in the User-Defined Variables section
  1. In the slide-out window, enter configuration name and click the Variable Configuration pane.
Variable configuration slideout with the variable name field highlighted and the Data Layer Variable type highlighted in the Choose variable type panel
  1. In the slide-out window, set the following parameters, then click Save:
  • Variable Type
  • Data Layer Variable Name
  • Data Layer Version
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 TypeData Layer Variable NameData Layer Version
Data Layer VariableeventActionVersion 2
Data Layer VariableeventCategoryVersion 2
Data Layer VariableeventLabelVersion 2
  1. 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.
Tag Configuration window for a GA4 Event tag with the Event Name, Event Parameters, and Firing Trigger esputnik event all highlighted
  1. Click Submit on the top panel.
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.
Analytics
  1. Select the widget, which events you want to export.
  2. In the Widget Details menu, select Integrations and enable the Export data to Google Analytics slide button.
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.
Google Analytics Realtime overview report with the Realtime menu item and Event count by Event name pane highlighted
  1. 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.

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.

ParameterDescription
eventActionIt contains the events as described in Event categories and actions.
eventCategoryWidget type.
eventLableWidget ID.

Event Categories and Actions

GA displays eSputnik events in a table as shown below.

Google Analytics table listing Reteno 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 typeDescription
BUILT_INInline widget/form
DETACHEDPop-ups
FLOATING_BOXFloating box, informer
LAUNCHERLauncher
CONTENT_LOCKERContent 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 ActionDescription
LauncherShow_ webThe launcher button displays on a website.
LauncherClick_The launcher button clicked.
FormShow_bsitThe form is displayed on a website.
FormClose_.A site visitor closed the form.
FormButtonClick_on.A site visitor clicked the form button.
FormClick_e wiA site visitor clicked anywhere within the form.
FormStartFilling_ forA site visitor started filling up the form.
FormFinish_bscrA 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.

Widgets page listing three widgets with the ID column highlighted

Comparing Widget Clicks with GA4 Sessions

šŸ“˜

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.



Did this page help you?