Through Blendee it is possible to draw a submit of the form and then pass the data to Google Analytics, let’s see how to do it.
Select the form you want to submit on by going to Website > Forms.
Locate the form and select Configure from the drop-down menu of the edit button.
In the configuration, we are going to edit the reply message, by clicking on the html editor button.
In the html code we insert an id with any value inside an html tag of our choice, for example here we have inserted the id in the first p> tag <of the reply message.
Let’s go ahead and save.
Let’s move on to Tag Manager
Let’s go to the site property , and create a new Trigger, of type Visibility of an element.
Let’s configure the trigger,
The first thing to do is to choose the selection method, either by ID or CSS selector.
We recommend using the ID as mentioned above.
After selecting ID, we enter the id written first on the appropriate input (element ID), select the item
“Whenever an item appears on the screen”, “Detect changes in the DOM”, and “All visibility events”.
Once the trigger is configured, let’s move to the TAGS section and create a new one.
TAGS WITH GA4:
Let’s select the GA4 event tag:
In the configuration we set the GA4 configuration tag
Next you need to enter the name of the event, GA4 has the names of the events already set up and listed online on this official Google guide .
Here we will find the whole list of custom events that can be tracked via GA4 and GTM.
Later you can also enter the parameters of the events, it is not mandatory, but you can do it to recognize where the submit comes from.
In fact, through the Page Url parameter and the value {{Page Url}} it is possible to pass the url of where the submission was made.
Using the lead_type parameter, we enter the name of the form as the value.
Finally, set as Activation, the previously created trigger of type Visibility of an element.
At this point, all that remains is to create the goal on Google Analytics, using the classic GA4/UA procedure and enter the same parameters entered.
So every time someone sees the reply message, and then submits, the tracking will be sent and counted.
Thanks for contributing!