How do I add an asset to every new theme that gets created?

Topic summary

Goal: ensure a script tag added by a Shopify app persists when a store switches to a new theme.

Context: the app can add a script tag as a theme asset, but the tag is lost when the store changes themes. The request is for a method that applies the asset to all future themes, not just the current one.

Latest suggestion: enter the script in the Google Analytics JavaScript field (a store setting) so it might not depend on a specific theme.

Status: no confirmation or consensus on the effectiveness of the suggestion; no resolved solution or documented approach in this thread.

Open question: is there a store-wide, theme-agnostic method to persist a script tag across theme changes via Shopify settings or app mechanisms? Pending clarification and testing.

Summarized with AI on February 5. AI used: gpt-5.

We are able to modify an asset for a specific theme and add a script tag as an asset to the theme through our Shopify application. But, when the store changes their theme, this script tag is lost.

How do I add an asset such that it applies to all new themes so that the new main theme also has this asset (script tag) available? I want this script tag to persist across themes (including new ones) and not just add this script tag (asset) to a specific theme.

Would you enter it in the google analytics js field?