how to track form submission | Community
Skip to main content
June 30, 2020
Solved

how to track form submission

  • June 30, 2020
  • 4 replies
  • 6758 views

I'm new in analytics, I have to find out the how many forms are completed so I created a rule in TMS but it's not working for testing I added alert into the custom code but again it not shown on the form submit

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by VaniBhemarasetty

Hi Pradeep, 

 

There is no "one-size-fits-all" solution for this.  Your solution is unique to how your site is setup.

For example, It depends on, does your form have a unique URL the visitor has to go to? Or is it some button you click and you get an overlay on a page? Is it embedded as an iframe on your site? 

 

However, you can refer to the below common methods

 

Method 1: If the event as to be triggered when a submit button is clicked, 

<button onclick="myFunction()">Click me</button>

<script>

function myFunction()

s.events="eventN" // where eventN can be any counter event, which increments by 1 when ever submit button is clicked.

s.tl();

}

</script>

 

Here s.tl() function is mandatory so that event is tracked, refer to this link to understand the use of 

s.tl() function 

https://docs.adobe.com/content/help/en/analytics/analyze/activity-map/link-tracking/activitymap-stl-track-custom-elements.html

Since, you are facing a trouble in tracking the triggers, please check whether s.tl function is added. 

 

Method 2: If there is a unique url, where the visitor will reach after submitting a form, 

For instance like visitor reach to a page url with  "thank you/successfully submitted the form" in url path or dom element has a value like above, you can fire a adobe analytics trigger to capture no of times the form is successfully submitted

 

Hope this helps

 

4 replies

VaniBhemarasetty
Adobe Employee
VaniBhemarasettyAdobe EmployeeAccepted solution
Adobe Employee
June 30, 2020

Hi Pradeep, 

 

There is no "one-size-fits-all" solution for this.  Your solution is unique to how your site is setup.

For example, It depends on, does your form have a unique URL the visitor has to go to? Or is it some button you click and you get an overlay on a page? Is it embedded as an iframe on your site? 

 

However, you can refer to the below common methods

 

Method 1: If the event as to be triggered when a submit button is clicked, 

<button onclick="myFunction()">Click me</button>

<script>

function myFunction()

s.events="eventN" // where eventN can be any counter event, which increments by 1 when ever submit button is clicked.

s.tl();

}

</script>

 

Here s.tl() function is mandatory so that event is tracked, refer to this link to understand the use of 

s.tl() function 

https://docs.adobe.com/content/help/en/analytics/analyze/activity-map/link-tracking/activitymap-stl-track-custom-elements.html

Since, you are facing a trouble in tracking the triggers, please check whether s.tl function is added. 

 

Method 2: If there is a unique url, where the visitor will reach after submitting a form, 

For instance like visitor reach to a page url with  "thank you/successfully submitted the form" in url path or dom element has a value like above, you can fire a adobe analytics trigger to capture no of times the form is successfully submitted

 

Hope this helps

 

VaniBhemarasetty
Adobe Employee
Adobe Employee
June 30, 2020

Hi Pradeep, 

 

There is no "one-size-fi)ts-all" solution for this.  Your solution is unique to how your site is setup. For example, does your form have a unique URL the visitor has to go to? Or is it some button you click and you get an overlay on a page? Is it embedded as an iframe on your site? 

 

However,  below are the two common methods to trigger a counter event in adobe analytics for form submissions

Method: To trigger a counter event when a submit button is click

<button onclick="myFunction()">Click me</button>

<script>

function myFunction()

{

s.events="eventN”; // eventN is the event assigned for tracking the number of form submissions

s.tl();

}

</script>

Note: This is just a sample custom code,however it will change based on the website

 

Here, s.tl(), function is mandatory to trigger a counter event in adobe analytics, Since you are facing a trouble in tracking, please check whether a s.tl() is added in the custom code

 

Refer to this link to understand the importance of s.tl function:

https://docs.adobe.com/content/help/en/analytics/implementation/vars/functions/tl-method.html

 

Method 2:  If the "thank you" page has a unique URL, can the user only get to it upon successful completion or similarly if there is a attribute like “submitted successfully, thank you for submitting the form” in a unique element Id as a part of dom, you can trigger a counter event to track the successful form submissions in adobe analytics.

 

Hope this helps

jantzen_b
Adobe Employee
Adobe Employee
April 13, 2021
Do any of the answers below answer your initial question? If so, can you select one of them as the correct answer? If none of the answers already provided answer your question, can you provide additional information to better help the community solve your question?
Level 5
January 12, 2022

Form submission can be tracked simply by using  _satellite.track() function. It’ll not only help in capturing the successful form submission. You can also pass additional information with this function as well.

Let’s say you want to capture the form submission whenever someone successfully submits the form i.e click on the submit button. You can ask your developer team to pass the code given below whenever someone clicks on the button

 

                                             _satellite.track(“submit” // identifier you want to pass//)

 

After passing the information. Create a direct call rule and pass the identifier. Identifier should be the same as you passed in the  _satellite.track() which will be ‘submit’ in this case.

 

 

Then further you can set variables, in which you can define which evar, prop and event should capture value when this event occurs.

 

 

In this way, you can easily capture the successful form submission.