|
| 1 | +--- |
| 2 | +name: update-sample-html-tracking-and-license |
| 3 | +description: 'Batch update HTML samples. Use this to batch-replace GTM code in HTML, move the `noscript` and `script` tags to the beginning of the `body`, batch-replace Dynamsoft license strings, and standardize sample tracking snippets.' |
| 4 | +argument-hint: 'Describe the target HTML scope and whether to update GTM, license, or both.' |
| 5 | +user-invocable: true |
| 6 | +--- |
| 7 | + |
| 8 | +# Update Sample HTML Tracking And License |
| 9 | + |
| 10 | +## When to Use |
| 11 | +- Batch update GTM snippets in sample HTML files. |
| 12 | +- Move GTM `noscript` and `script` blocks to the start of `<body>`. |
| 13 | +- Replace an old Dynamsoft sample license string with a new one. |
| 14 | +- Normalize multiple sample pages to the same HTML tracking structure. |
| 15 | + |
| 16 | +## Inputs To Confirm |
| 17 | +- Which HTML files are in scope. |
| 18 | +- Whether the task is GTM only, license only, or both. |
| 19 | +- The exact old and new strings if replacing license values. |
| 20 | +- Whether the GTM block should be inserted in `<head>` or at the start of `<body>`. |
| 21 | +- Whether `frameworks/**/*.html` should be excluded. Default: exclude framework HTML from license replacement unless explicitly requested. |
| 22 | + |
| 23 | +## Procedure |
| 24 | +1. Search the repository for the current GTM ID or license string to get the exact file list. |
| 25 | +2. Inspect 2 to 3 representative files to confirm whether the GTM block is in `<head>`, between `</head>` and `<body>`, or already inside `<body>`. |
| 26 | +3. If updating GTM placement, remove the existing block from its current location and insert the canonical block from [assets/gtm-block.html](./assets/gtm-block.html) immediately after `<body>`. |
| 27 | +4. If updating license text, replace only the exact old license string and leave surrounding code untouched. |
| 28 | +5. By default, exclude `frameworks/**/*.html` from license replacement unless the user explicitly includes framework HTML. |
| 29 | +6. Verify there are no remaining GTM blocks under `<head>` or between `</head>` and `<body>`. |
| 30 | +7. Verify the GTM block appears once per target file at the start of `<body>`. |
| 31 | +8. Verify the old license string no longer exists in the intended non-framework files and that framework HTML retains its original license unless explicitly included. |
| 32 | + |
| 33 | +## Output Expectations |
| 34 | +- Minimal, scoped HTML edits only. |
| 35 | +- No unrelated formatting changes. |
| 36 | +- A short report with file count, what changed, and verification results. |
| 37 | + |
| 38 | +## Notes |
| 39 | +- For HTML validity, `noscript` with iframe should live under `<body>`. |
| 40 | +- Keep the `script` and `noscript` together when the request is to standardize placement. |
| 41 | +- Prefer repository-local skill reuse for this sample set. |
0 commit comments