# New JS tracking: external form submissions

**URL:** <https://forum.mautic.org/t/new-js-tracking-external-form-submissions/4443>\
**Category:** Product Support\
**Created:** [June 11, 2016, 8:24pm UTC](https://forum.mautic.org/t/new-js-tracking-external-form-submissions/4443 "2016-06-11T20:24:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvissers](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mvissers](https://forum.mautic.org/u/mvissers)\
**Post date:** [June 11, 2016, 8:24pm UTC](https://forum.mautic.org/t/new-js-tracking-external-form-submissions/4443/1 "2016-06-11T20:24:52Z")

</div>

Hi  
  
  
  
My situation: I have an external CMS-platform with built-in forms (directly plugging in a Mautic form isn’t that easy).  
  
And I have a mautic where I have replicated the forms which are on the website.  
  
I’m using the latest version of Mautic, with the new javascript tracking (instead of the pixel).  
  
  
  
Now to the point: what I want to do is, is to when the form is submitted (handled by the CMS), I want also want to sent the trigger to Mautic.  
  
I was thinking of “onFormSubmit()”, capturing the form-data, and triggering the javascript-method to send the action with the form-data to Mautic.

1. Is this a good way of working, or am I totally mis(b)using the javascript tracker? ![:-)]( ":-)")  
  
If the answer is “dude what the hell are you doing”, I’ll have to re-write the form-handler of the CMS based on this information? ([https://medium.com/@jan\_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005#.ue75vw4ch](https://medium.com/@jan_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005#.ue75vw4ch))  
  
  
2. If this is Javascript-form-handling thing is a good way of working: which parameters have I to use to trigger the form submission?  
  
I can store the personal fields as described on [https://github.com/mautic/documentation/pull/54/files](https://github.com/mautic/documentation/pull/54/files)

Code:

e.g. mt('send', 'pageview', {email: 'my@email.com', firstname: 'John'});

but I want of course track the "form submit action" to make follow-up actions ("when form submitted, do this, do that").  
I would expect something like

Code:

e.g. mt('send', 'formsubmit', {email: 'my@email.com', firstname: 'John', formid: 15, textfield: 'hello world'});

  
I hope my question is clear ![:-)]( ":-)")  
I really love the new javascript tagging, but it's all new ![:-)]( ":-)")

---

<div class="post-metadata">

**Author:** ![pierre\_a](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/pierre_a/32/7031_2.png) [@pierre\_a](https://forum.mautic.org/u/pierre_a)\
**Post date:** [July 6, 2016, 12:18pm UTC](https://forum.mautic.org/t/new-js-tracking-external-form-submissions/4443/2 "2016-07-06T12:18:02Z")

</div>

Hello,

I have open mtc.js file. I don’t see ‘formsubmit’ call. At present you can use only ‘pageview’.

Best regards,  
Pierre

---

<div class="post-metadata">

**Author:** ![mvissers](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mvissers](https://forum.mautic.org/u/mvissers)\
**Post date:** [June 11, 2016, 8:24pm UTC](https://forum.mautic.org/t/new-js-tracking-external-form-submissions/4443/3 "2016-06-11T20:24:52Z")

</div>

Hi

My situation: I have an external CMS-platform with built-in forms (directly plugging in a Mautic form isn’t that easy).  
And I have a mautic where I have replicated the forms which are on the website.  
I’m using the latest version of Mautic, with the new javascript tracking (instead of the pixel).

Now to the point: what I want to do is, is to when the form is submitted (handled by the CMS), I want also want to sent the trigger to Mautic.  
I was thinking of “onFormSubmit()”, capturing the form-data, and triggering the javascript-method to send the action with the form-data to Mautic.

1. Is this a good way of working, or am I totally mis(b)using the javascript tracker? 🙂  
If the answer is “dude what the hell are you doing”, I’ll have to re-write the form-handler of the CMS based on this information? ([https://medium.com/@jan\_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005#.ue75vw4ch](https://medium.com/@jan_linhart/the-simplest-way-how-to-submit-a-form-data-to-mautic-1454d3afd005#.ue75vw4ch))

2. If this is Javascript-form-handling thing is a good way of working: which parameters have I to use to trigger the form submission?  
I can store the personal fields as described on [https://github.com/mautic/documentation/pull/54/files](https://github.com/mautic/documentation/pull/54/files)

```auto
e.g. mt('send', 'pageview', {email: 'my@email.com', firstname: 'John'});
```

but I want of course track the “form submit action” to make follow-up actions (“when form submitted, do this, do that”).  
I would expect something like `e.g. mt('send', 'formsubmit', {email: 'my@email.com', firstname: 'John', formid: 15, textfield: 'hello world'});`

I hope my question is clear 🙂  
I really love the new javascript tagging, but it’s all new 🙂
