📜 ⬆️ ⬇️

Form Tracking with Google Analytics

The effectiveness of a commercial online project depends on the number of orders, registrations, reviews and other feedback elements left by site visitors through the electronic form.

Accordingly, the form is a vulnerable point for receiving such requests, which can reduce their number due to its inefficiency.

You can use a variety of methods for evaluating performance, but for now we’ll focus on evaluating forms using Google Analytics web analytics.
')
image

The idea of ​​this method is taken from the article "Use Virtual Page Views Abandon From" .

This article examines its application in practice.

Tracking using events in Google Analytics


First, we’ll determine how data will be sent to Google Analytics. For this we will use the event tracking method existing in the system.

All data received from forms will be sent to Google Analytics using the _trackEvent () method.

The specification of this method is as follows:
_trackEvent (category, action, opt_label, opt_value)

category (required) - the name for the group of objects that should be monitored

action (required) - this property determines the type of interaction with the site (click, download, view, etc.)

label (optional) - additional characteristics of the events being monitored (the name of the file being downloaded, the name of the page on which the event took place, etc.)

value (optional) is an integer that can be used to provide numerical data about monitored events

Installation code on the site


So far we have determined how the data will be transmitted to Google Analytics.

Now consider where and how data will be taken.

To do this, use the jQuery library.

To transfer the page address to the Google Analytics web analytics system, use the jquery url parser and : input Selector of the jQuery library.

As a result, the code processing the form on the page will look as follows:
 <script type="text/javascript"> $(document).ready(function() { var currentPage = jQuery.url.attr("path"); $(':input').blur(function () { if($(this).val().length > 0){ pageTracker._trackEvent("Form: " + currentPage, "input_exit", $(this).attr('name')); } }); }); </script> 

The event values ​​(label) are taken from the “name” attribute of the form fields.

In the tag “head” we write the library connection strings:



Findings from Google Analytics reports


The results can be observed in the report “Event Tracking” of Google Analytics.

This report is located in the "Content" menu:

image

Going to the "Categories" subsection, we will see a report containing a list of all forms indicating the pages on which they were placed and where the actions were taken. This report also displays the number of events for each form.

image

By clicking on the address of the form you can read the report containing all the events associated with it.

image

Event labels are those form fields in which the activity of site visitors was recorded.

The original form is as follows:

image

What conclusions can be drawn from the data obtained:

Source: https://habr.com/ru/post/100930/


All Articles