R
R
Rezvan Abdunov2018-05-24 10:48:05
Google Analytics
Rezvan Abdunov, 2018-05-24 10:48:05

How to track form submission in GTM?

The essence of the task is to listen to the submission of the subscription form and pass this event to Google Analytics as a goal through gtm.
And everything would be easy and great if this form would be ordinary.
But technically, this is a subscription form, not a form , and I can’t understand how such a form can be passed to gtm.

<div class="ulp-content" style="transform: translate(0px, 0px) scale(1);">
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-355" data-left="0" data-top="15" data-appearance="fade-in" data-appearance-speed="1000" data-appearance-delay="0" data-scrollbar="off" data-confirmation="off" style="left: 0px; top: 15px;"></div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-356" data-left="0" data-top="15" data-appearance="fade-in" data-appearance-speed="1000" data-appearance-delay="0" data-scrollbar="off" data-confirmation="off" style="left: 0px; top: 15px;"></div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-363" data-left="85" data-top="285" data-appearance="slide-up" data-appearance-speed="1000" data-appearance-delay="1000" data-scrollbar="off" data-confirmation="off" style="left: 85px; top: 285px;"><i class="fa fa-lock"></i> Мы не рассылаем Спам и не передаем третим лицам ваши данные.</div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-357" data-left="15" data-top="35" data-appearance="slide-down" data-appearance-speed="1000" data-appearance-delay="200" data-scrollbar="off" data-confirmation="off" style="left: 15px; top: 35px;">Ваш убойный заголовок</div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-359" data-left="15" data-top="155" data-appearance="slide-down" data-appearance-speed="1000" data-appearance-delay="200" data-scrollbar="off" data-confirmation="off" style="left: 15px; top: 155px;">Описание</div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-358" data-left="15" data-top="135" data-appearance="slide-right" data-appearance-speed="1000" data-appearance-delay="300" data-scrollbar="off" data-confirmation="off" style="left: 15px; top: 135px;"></div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-364" data-left="350" data-top="45" data-appearance="slide-down" data-appearance-speed="1000" data-appearance-delay="200" data-scrollbar="off" data-confirmation="off" style="left: 350px; top: 45px;">Заполните форму и нажмите кнопку (Ваш продукт)</div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-362" data-left="350" data-top="220" data-appearance="slide-up" data-appearance-speed="1000" data-appearance-delay="900" data-scrollbar="off" data-confirmation="off" style="left: 350px; top: 220px;"><a href="#" class="ulp-submit ulp-inherited" onclick="return ulp_subscribe(this);" data-label="Отправить" data-loading="Отправляю...">Отправить</a></div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-361" data-left="350" data-top="170" data-appearance="slide-left" data-appearance-speed="1000" data-appearance-delay="800" data-scrollbar="off" data-confirmation="off" style="left: 350px; top: 170px;"><input class="ulp-input ulp-input-field" type="email" name="ulp-email" placeholder="Введите Свой E-mail..." value="" onfocus="jQuery(this).removeClass('ulp-input-error');" data-tamboo-input-id="2"></div>
                <div class="ulp-layer" id="ulp-inline-layer-9T191d96aD3OKCSG-360" data-left="350" data-top="120" data-appearance="slide-right" data-appearance-speed="1000" data-appearance-delay="700" data-scrollbar="off" data-confirmation="off" style="left: 350px; top: 120px;"><input class="ulp-input ulp-input-field" type="text" name="ulp-name" placeholder="Введите Имя..." value="" onfocus="jQuery(this).removeClass('ulp-input-error');" data-tamboo-input-id="3"></div>
              </div>

link to the page with the test form - https://abdunovrezvan.com/testfoma/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2018-06-01
@protasoveo

Hello!
I suspect that it is problematic to change the form or hang a json handler so that, if successful, it sends data to the dataLayer.
It remains to listen to all ajax requests and send them to the dataLayer, and send the required request to the analytics as an event, and then it’s clear.
Here is an example from Lunametrics:
https://www.lunametrics.com/blog/2015/08/27/ajax-e...
PS
This is not the final solution, but a tip for those who read the comment and add the code. I don't have time, unfortunately.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question