Expand my Community achievements bar.

SOLVED

Form submit tracking stopped working

Avatar

Level 6

Form submit tracking stopped working after moving to a single-page application. How to handle this? This is the CSS selector that we use in the core submit type event in launch rule  "#atomic-submit" Any custom code to listen to form submit?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

This all depends on how the form was coded... 

 

In most cases, SPAs shouldn't break the default form behaviour.. that said, a lot of developers have started throwing in code that breaks that action (in lieu of their own custom code)... in that case it's very hard to deal with.

 

The first step I would suggest would be to work with your developers... see why they disabled the default "form submit" action... is there a legitimate reason? Can it be re-enabled without breaking something, etc...

 

If they can't re-enable that, then maybe you can have them trigger a custom JS event that you can use a custom code "event listener" to create your trigger.

 

Without seeing the implementation I can really only give generic solutions at this time.

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

This all depends on how the form was coded... 

 

In most cases, SPAs shouldn't break the default form behaviour.. that said, a lot of developers have started throwing in code that breaks that action (in lieu of their own custom code)... in that case it's very hard to deal with.

 

The first step I would suggest would be to work with your developers... see why they disabled the default "form submit" action... is there a legitimate reason? Can it be re-enabled without breaking something, etc...

 

If they can't re-enable that, then maybe you can have them trigger a custom JS event that you can use a custom code "event listener" to create your trigger.

 

Without seeing the implementation I can really only give generic solutions at this time.