Skip to content

Stop translating goal, event and funnel names - #329

Merged
Dan0sz merged 2 commits into
developfrom
stable_goal_names
Sep 29, 2026
Merged

Dan0sz merged 2 commits into
developfrom
stable_goal_names

Conversation

@Dan0sz

@Dan0sz Dan0sz commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #326.

Goal, event and funnel names identify the goals and funnels in Plausible, but were wrapped in __(). When the French translations of these strings were updated on translate.wordpress.org (17 Sep 2026), fr_FR sites started sending e.g. Achat WooCommerce finalisé instead of Woo Complete Purchase. Each goal's data was split in two, and revenue silently stopped being recorded, because the translated purchase goal isn't a Revenue goal.

Also broken before that

  • The goals for cloaked links, search queries and query parameters were created with the translated names, while the JS sends their events under the English names ('Cloaked Link: Click', 'WP Search Queries', 'WP Query Parameters'). On a translated site those goals never converted.
  • Goals are provisioned in the admin's (user) locale, while events are sent in the site's locale (per language with WPML), so the two could differ even without a translation update.

Changes

  • The WooCommerce and EDD event names, the custom event goals (Provisioning), the form completions event and the funnel names are now plain English strings, with a comment explaining why they mustn't be translated. Labels in the settings screen stay translatable.
  • Tests that a translation doesn't change the names (they fail on develop).
  • Changelog entry under 2.6.2.

Impact on existing sites

Only French translates these strings (checked fr, de, nl, es, it, pt-BR, ja, pl, sv, da, nb, ru, tr and zh-CN). On French sites, events are sent to the original English goals again, which still exist, including the Revenue goal. So the history before 17 September reconnects and revenue is recorded again; only the period since then stays split. Goals and funnels created with the French names (on a settings save after 17 September) are left alone: they're harmless, and the changelog tells site owners they can remove them.

Testing

  • Full test suite passes.
  • Live, with the fr_FR language pack from translate.wordpress.org and the site's locale set to fr_FR, as a logged-out visitor (add to cart, checkout, order) and in the French wp-admin:
add to cart checkout purchase goals created on settings save
develop Ajout au panier WooCommerce Début de la commande WooCommerce – (not run, to keep French goals off the test dashboards)
this branch Woo Add to Cart Woo Start Checkout Woo Complete Purchase with revenue none in French; funnels unchanged

Summary by CodeRabbit

  • Bug Fixes
    • Event and funnel names now remain consistent across languages, helping prevent translated names from splitting goal data or interrupting revenue tracking.
    • French sites affected by September 2026 translations send events to their original goals again. Goals created with French names can be removed from the Plausible dashboard.

Upgrade routine

French 2.6.1 sites that connected after 17 September only have goals with French names. As of 2.6.2 they send their events under the English names, but those goals would only be created on the next settings save, leaving purchases without a Revenue goal until then. upgrade_to_262() now (re)creates the custom event goals for every install and the funnels for every ecommerce install (previously only multilingual ones). Both are get-or-create, so existing goals and funnels are left unchanged.

Base currency of a new Revenue goal

Helpers::get_currency_for_language() fell back to get_woocommerce_currency(), which multicurrency plugins filter to the currency of the current request: on the test site WCML returned USD from wp-cli and EUR in AJAX requests (e.g. Action Scheduler's, which can run the upgrade), while the store's base currency is EUR. It now reads WooCommerce's woocommerce_currency setting, so a new Revenue goal's currency no longer depends on which request provisions it. Existing purchase goals keep their currency, as before.

Testing (upgrade)

  • A dashboard set up like a French 2.6.1 site (only French goals and funnel, created with the exact names from translate.wordpress.org), then the upgrade: the English goals, including the Revenue goal, and the "Woo Purchase Funnel" are created; the French goals and funnel are left alone. Verified both when the upgrade was triggered in the background by a WooCommerce admin-ajax.php request, and when run from wp-cli, where WCML reports USD: the Revenue goal is created in the store's base currency (EUR).
  • The updated currency test fails on develop (it returns the filtered currency).

The names identify the goals and funnels in Plausible, but were wrapped
in __(). When the French translations of these strings were updated on
translate.wordpress.org (17 Sep 2026), fr_FR sites started sending e.g.
"Achat WooCommerce finalisé" instead of "Woo Complete Purchase": each
goal's data was split in two and revenue silently stopped being recorded,
as the translated purchase goal isn't a Revenue goal.

It was already inconsistent before that: the goals for cloaked links,
search queries and query parameters were created with the translated
names, while the JS sends their events under the English names, so on a
translated site those goals never converted. And goals are provisioned in
the admin's (user) locale, while events are sent in the site's locale.

Use the English names as plain strings for the WooCommerce and EDD events,
the custom event goals, the form completions event and the funnel names.
French sites then send their events to the original (English) goals again,
which still exist, including the Revenue goal.

Fixes #326
@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 366fde52-0383-48aa-b313-a745c2e84aaa

📥 Commits

Reviewing files that changed from the base of the PR and between 116d03e and c71eba2.

📒 Files selected for processing (10)
  • readme.txt
  • src/Admin/Provisioning.php
  • src/Admin/Provisioning/Integrations.php
  • src/Admin/Provisioning/Integrations/EDD.php
  • src/Admin/Provisioning/Integrations/WooCommerce.php
  • src/Integrations/EDD.php
  • src/Integrations/FormSubmit.php
  • src/Integrations/WooCommerce.php
  • tests/integration/Admin/ProvisioningTest.php
  • tests/integration/Integrations/WooCommerceTest.php

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Event-goal and funnel names now use fixed English strings instead of WordPress translations. Integration tests check that translation filters do not change selected event-goal names. The changelog describes the French-site case.

Changes

Stable goal and funnel names

Layer / File(s) Summary
Use fixed names for goals and funnels
src/Admin/Provisioning.php, src/Admin/Provisioning/Integrations/*, src/Integrations/*, tests/integration/Admin/ProvisioningTest.php, tests/integration/Integrations/WooCommerceTest.php, readme.txt
Enhanced Measurement, EDD, WooCommerce, and form-submission event-goal names now use fixed English strings. EDD and WooCommerce funnel names also use fixed English strings. Tests check that translation filters do not change selected goal names. The changelog describes the French-site case.

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to c71eb

The changed identifiers remain consistent between provisioning and event tracking. No material merge-blocking risk is evident.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c71eb

Fixed names should keep events aligned with their analytics goals across languages. On sites with previously translated goals, disabling an integration may leave those older goals behind. No new access path or privilege was identified.

Retained concerns

  • Low · architecture · inferred: On sites with previously translated integration goals, disabling the integration can leave those goals in Plausible and in the plugin's stored goal-ID record: cleanup compares their old names with the new English names.
Security review details

Security Blast Radius

  • inferred — The affected remote operations remain goal and funnel provisioning for configured Plausible clients. The identifier change does not establish a new cross-site authority or attacker-controlled goal name.

Trust Boundaries and Controls

  • observed — Settings select among predefined measurement keys before provisioning constructs goal requests; the changed event names are supplied by the plugin rather than by a new request field.

Resilience and Maintainability Implications

  • inferred — The remaining risk is configuration ownership drift during transition or disablement, rather than an identified privilege or data-access change. Whether repeated remote requests are fully idempotent depends on the Plausible API response contract.

Hardening Proposals

  • proposed — Define an explicit policy for recognizing or retaining historical translated resources on disablement, using recorded goal ownership without indiscriminately deleting analytics history.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #326 requires stable Plausible goal and event identifiers. The PR replaces translated WooCommerce and EDD event names, custom event goal names, and the form completion name with fixed English st…
Out of Scope Changes check ✅ Passed The changed files support Issue #326. The changelog documents the fix. Comments explain the stable identifier requirement. The tests verify the non-translatable names. No unrelated product behavior is…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 9 files. (1 skipped: 1…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: goal, event, and funnel names are no longer translated.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sites whose goals were created under translated names (French 2.6.1 sites
that connected after 17 Sep 2026 only have French goals) send their events
under the English names as of 2.6.2, but the plugin only created those
goals on the next settings save, leaving e.g. purchases without a Revenue
goal until then. upgrade_to_262() now (re)creates the custom event goals
for every install, and the funnels for every ecommerce install, not only
multilingual ones. Both are get-or-create, so existing goals and funnels
are left unchanged.

Also read the base currency for a new Revenue goal from WooCommerce's
setting instead of get_woocommerce_currency(): multicurrency plugins filter
the latter to the currency of the current request (WCML returns the
visitor's currency in AJAX requests, e.g. the Action Scheduler requests
that can run the upgrade), so the goal's currency depended on whichever
request happened to provision it.
@Dan0sz
Dan0sz merged commit f2d29a1 into develop Sep 29, 2026
7 checks passed
@Dan0sz
Dan0sz deleted the stable_goal_names branch September 29, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Translated goal names break existing goals and revenue tracking after a language pack update

1 participant