Reputation: 11
I'm trying to track form submissions by creating a data element and rule in Adobe DTM. I'm new to DTM and am having difficulty configuring the tag correctly. Here's a screenshot of my code: http://zeffective.d.pr/1hTHa. How should I create this rule in DTM to track email form submissions as an event in GUA (I've created a tool for GUA in DTM already).
Upvotes: 0
Views: 815
Reputation: 800
If you have form validation happening I would not use an on click event in DTM. For form submissions, my preferred method is to use the form onsubmit handler and fire a direct call event to DTM after any other logic / validation happens.
_satellite.track('lead_form_submit');
Set up all your tracking logic in a Direct call rule that has a string to match what you pass to track. ie. 'lead_form_submit' or whatever you name it.
Upvotes: 0
Reputation: 66
Best way to set it up correctly is:
create event base rule, chose event type click and check option delay link activation (this will avoid page reload before analytics call is made).
Apply event handler directly to element - leave this option unchecked.
Please do not set any other conditions as mentioned in comments above. Choose analytics tool set s.tl and map your evars/props/events
Also, please check _sattelite.getVar("data element name") function to check that Data Elements are resolved properly.
Use browser addons like omnibug to check that calls are made as expected.
In section Javascript / Third Party Tags, for testing purposes you can add following java script:
console.log('new submission');
hope it helps.
Upvotes: 0
Reputation: 421
There are several ways to do this (jQuery form submit, etc) but using an event-based rule should work just fine.
Something like this:
Event Type: Click
Element Tag or Selector: button.form-submit.disabled-submit // class name
Apply Event Handler Directly to Element
// Adobe Analytics Section
// Select s.tl (does not increment a PV)
// Set events or vars
You can also do this with a page rule that uses jQuery and listens for the form.submit.
Hope this helps.
Upvotes: 2