See the result of a form process submit button in adobe analytics

1k Views Asked by At

I have a form in a classic version with a submit button

<form action="" name="frm" mathed="">
<input type="submit" value="submit">
</input>

I have enabled a jquery command in order to track in adobe anlytics site that the submission of form was succesfull and have some values with this

 $("#frm").submit(function(){
            s.linkTrackVars="pageName";
            s.pageName = 'test_form';
            s.tl(true,'o','link', null,'navigate');
            });

How can I confirm in omniture (adobe analytics) side that the submission was successful and se the results?

1

There are 1 best solutions below

0
On BEST ANSWER

Firstly, you mention wanting to track that the form has been successfully submitted. I'm not sure how you define "successful" but commonly that means that the form passed validation (e.g. all form fields filled out, proper format, etc.). However, you currently have the Adobe Analytics (AA) tracking implemented to pop on the submit event, which may not necessarily mean the form has actually passed whatever validation you may have in place.

Secondly, the only AA variable you are setting is pageName, which is one of the few AA vars you should usually never set (override) on s.tl() calls. Generally speaking, pageName is set for a page view which is done with an s.t() call. Then, events/actions that happen on the page are tracked with an s.tl() call, and AA code already automatically includes the current page's pageName value in that request. Within the reports, AA then associates the activity with that page name, but disregards it as far as an actual page view happening.

Now, it may be that you want to track successful form submissions as a separate page view, in which case, you should indeed set pageName with a new (unique) value, but you don't need to "register" it in linkTrackVars and you should be using s.t() not s.tl() to trigger it. Ideally though, you should place it on a real "thank you" / "confirmation" page (though it may be that you don't actually have that).

So what should you pop then? If you go the "track it as a separate page view (s.t()) call with a unique pageName value, for your purposes that may be enough. You can look at your pages report and see your value show up and how many times a visitor hit it.

But in general, the more common method of form tracking involves at least one eVar and two events. This is the common basic form tracking setup.

I use the following AA var/events in this example

eVar1- This signifies a name for the form. Expiration should be set to expire on event2.

event1 - This signifies form view happened

event2 - This signifies successful form complete happened.

On form view

On form view, your on-page code should look something like this in principle:

<script src='s_code.js'></script>
<script>
s.pageName="unique page name"; // leave blank if you want AA to default to using URL in pages report
s.eVar1="unique descriptive form name here";
s.events="event1";
s.t();
</script>

On successful form submit

Ideally, you should have a "thank you" / confirmation page that the visitor is redirected to upon successful form completion, and on that page, you should have this in principle:

<script src='s_code.js'></script>
<script>
s.pageName="unique page name"; // leave blank if you want AA to default to using URL in pages report
s.events="event2";
s.t();
</script>

If you really want to do it your method (attaching to submit event), it'd look like this (p.s.- according to your posted code, your form doesn't have an id='frm' so the selector won't actually work, but I'm only addressing the actual AA code here):

$("#frm").submit(function(){
  s.linkTrackEvents="event2";
  s.linkTrackVars="events";
  s.events="event2";
  s.tl(true,'o','form submit');
});

Or, if you want to track it as a separate page view but triggered on submit (note: this will also record any other vars you already have set from initial page view, so you may need to do something about that (e.g. set different values for them too, or blank them out, etc..) depending on the intended purpose of any other vars you have):

$("#frm").submit(function(){
  s.pageName="unique page name"; // leave blank if you want AA to default to using URL in pages report
  s.events="event2";
  s.t();
});

But as I mentioned above.. this may or may not accurately signify that a visitor actually successfully completed the form..

What report to look at

Okay so with the example above, you can then look at eVar1 report and select event1 and event2 as your metrics. This will show you how many people viewed and then went on to complete the form. If you have more than one form, you can use a different value in eVar1 and the report will show views/completes for each form.