Skip to content

v2.0.20 - Unable to clear "Google Analytics ID" field due to validation error (legacy UA/GTM requirement) #1169

@sergit90

Description

@sergit90

Hello, I am unable to leave the "Google Analytics ID" field empty to disable the module's built-in tracking. When I attempt to clear the field, I receive the following validation error:

"Google Analytics ID must start with 'UA-' or 'GTM-'"

Additionally, the field does not seem to accept valid GA4 IDs (which start with G-), limiting the usage to deprecated* Universal Analytics or GTM.

To Reproduce:
Go to the Google Analytics module configuration (or SEO configuration settings).
Clear the input field for "Google Analytics ID".
See the validation error preventing the save.

Expected behavior: I should be able to leave the field empty to disable the automatic script injection. Additionally, the validation should allow modern GA4 IDs (G-).

Additional context I need to implement a custom script in the section for GA. However, because I cannot clear this field, the module forces its own script injection, resulting in duplicate tracking tags on the site. I have also tried clearing it from the generic SEO configuration section without success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions