I need to add a script to forms in:
1. Forms in marketo landing pages
2. Forms in non-marketo landing pages
Whats the best place put to put it?
1. In the marketo landing page meta tag settings?
2. Within the embed script?
<script>MktoForms2.loadForm("//app-ab14.marketo.com", "961-UXG-821", 1348);</script>
The doc also details how to do it on Marketo LP's.
I wouldn't try to "touch up" the default embed script per se, since anytime someone re-pastes that block from the UI, they'd overwrite anything you might have added to it.
We most often include a remote form behaviors <script> in the template, bu you can store behaviors anywhere you want, including in an inline <script> tag -- as long as you (a) make sure the forms library is loaded before you reference MktoForms2, and (b) properly document what the script does. Accomplishing (b) can be as simple as giving the script a verbose id (id="formsCustomBehaviors-1.0.1") and/or setting it off with an HTML <!-- comment -->. A script with no labels is what you want to avoid.
We see a lot of pages with inline <scripts> sprinkled throughout the page, each calling MktoForms2.whenReady or another method. This is really hard to manage over time and getting yourself in the mode of creating a shared, separate behaviors script will pay off later (even if at the beginning it only has a few lines of code).