diff --git a/config.toml b/config.toml
index 39a4313..31ecd78 100644
--- a/config.toml
+++ b/config.toml
@@ -383,7 +383,7 @@ service = "goatcounter"
# Unique identifier for tracking.
# For GoatCounter, this is the code you choose during signup.
# For Umami, this is the website ID.
-# For Plausible, this is the domain name (e.g. "example.com").
+# For Plausible, this is the random script name without the extension (e.g. "pa-XXXXXX") or the domain name (legacy mode, e.g. "example.com").
# Note: Leave this field empty if you're self-hosting GoatCounter.
# id = "yourID"
diff --git a/content/blog/mastering-tabi-settings/index.md b/content/blog/mastering-tabi-settings/index.md
index 68e399a..b68dca1 100644
--- a/content/blog/mastering-tabi-settings/index.md
+++ b/content/blog/mastering-tabi-settings/index.md
@@ -835,7 +835,7 @@ You can set them up in the `[extra.analytics]` section of your `config.toml`.
- `id`: The unique identifier for your analytics service. This varies based on the service:
- For GoatCounter, it's the code chosen during signup. Self-hosted instances of GoatCounter don't require this field.
- For Umami, it's the website ID.
- - For Plausible, it's the domain name.
+ - For Plausible, it's either the random script name without the extension (e.g. `"pa-XXXXXX"`) or the domain name (legacy mode).
- `self_hosted_url`: Optional. Use this field to specify the URL for self-hosted instances of your chosen analytics service. The base URL differs based on your specific setup. Some examples:
- For GoatCounter: `"https://stats.example.com"`
diff --git a/templates/partials/analytics.html b/templates/partials/analytics.html
index 6a5d30e..3c18f11 100644
--- a/templates/partials/analytics.html
+++ b/templates/partials/analytics.html
@@ -28,11 +28,20 @@
{% if config.extra.analytics.do_not_track %}data-do-not-track="true"{% endif %}>
- {% elif analytics_service == "plausible" %}
+{% elif analytics_service == "plausible" %}
+{% if analytics_id is matching("^pa-[^\.]+$") %}
+ {# Use new script available in Plausible 3.1.0 or later #}
+
+
+{% else %}
+{% endif %}
{% endif %}
diff --git a/theme.toml b/theme.toml
index c3ecdb6..5407ee9 100644
--- a/theme.toml
+++ b/theme.toml
@@ -331,7 +331,7 @@ custom_subset = true
# Unique identifier for tracking.
# For GoatCounter, this is the code you choose during signup.
# For Umami, this is the website ID.
-# For Plausible, this is the domain name (e.g. "example.com").
+# For Plausible, this is the random script name without the extension (e.g. "pa-XXXXXX") or the domain name (legacy mode, e.g. "example.com").
# Note: Leave this field empty if you're self-hosting GoatCounter.
# id = "yourID"