|
25 | 25 | <script src="js/formDataToJson.js"></script> |
26 | 26 | <script src="js/exemptionQuizHandler.js"></script> |
27 | 27 | <script src="js/autoGenerateFields.js"></script> |
| 28 | + |
| 29 | + <!-- We participate in the US government's analytics program. See the data at analytics.usa.gov. --> |
| 30 | + <script async type="text/javascript" src="https://dap.digitalgov.gov/Universal-Federated-Analytics-Min.js?agency=HHS&subagency=CMS&sitetopic=metadata&siteplatform=GitHubPages" id="_fed_an_ua_tag"></script> |
| 31 | + |
28 | 32 | <script type="text/javascript"> |
29 | 33 | createFormComponents() |
30 | 34 | .then((components) => { |
|
34 | 38 | components: components, |
35 | 39 | }).then(function (form) { |
36 | 40 | window.formIOInstance = form; |
| 41 | + |
| 42 | + // form start must only fire once |
| 43 | + let formStartFired = false; |
| 44 | + form.on("focus", function () { |
| 45 | + if (!formStartFired) { |
| 46 | + formStartFired = true; |
| 47 | + gas4('form_start', { |
| 48 | + 'form_name': 'code.json form', |
| 49 | + 'form_id': 'formio', |
| 50 | + 'form_destination': window.location.pathname |
| 51 | + }); |
| 52 | + } |
| 53 | + }); |
| 54 | + |
37 | 55 | form.on("submit", function (submission) { |
38 | 56 | console.log("Form Submission here:", submission); |
39 | 57 | createCodeJson(submission.data); |
| 58 | + |
| 59 | + gas4('form_submit', { |
| 60 | + 'form_name': 'code.json form', |
| 61 | + 'form_id': 'formio', |
| 62 | + 'form_destination': window.location.pathname, |
| 63 | + 'form_submit_text': 'Generate code.json metadata' |
| 64 | + }); |
40 | 65 | }); |
41 | | - }); |
| 66 | + }) |
42 | 67 | }) |
43 | 68 | .catch((error) => { |
44 | 69 | console.error("Error creating components:", error); |
@@ -292,6 +317,7 @@ <h2>Complete the entire form to generate the code.json file</h2> |
292 | 317 | indicates a required field</em></p> |
293 | 318 | </div> |
294 | 319 |
|
| 320 | + <!-- Generated Form --> |
295 | 321 | <div id="formio"></div> |
296 | 322 |
|
297 | 323 | <!-- code.json Generated Output --> |
|
0 commit comments