diff --git a/CLAUDE.md b/CLAUDE.md index f1f520a..4f0806d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -21,7 +21,7 @@ The project includes frontend test tooling for the React admin interface: ## Documentation Language -All specs and planning artifacts are written in English — OpenSpec proposals, delta specs, design docs and task lists under `openspec/changes/`, PRDs, plans and analysis docs under `.claude/tasks/`, plus the changelog and README. This holds regardless of the language of the conversation that produced them: chat may be in Russian, the written artifact is English. +All specs and planning artifacts are written in English — OpenSpec proposals, delta specs, design docs and task lists under `openspec/changes/`, PRDs, plans and analysis docs under `.claude/tasks/`, plus the changelog and README. Chat is in English as well. ## Version Bump diff --git a/README.md b/README.md index 7286e51..936cddb 100644 --- a/README.md +++ b/README.md @@ -423,7 +423,7 @@ Yes. Turn on product IDs in WooCommerce Settings and choose the format that matc ### Can I stop admins and staff being tracked? -Yes. Under Advanced Settings, choose any user roles (Administrator, Editor, Shop manager and more) that should not have the tracking script loaded. +Yes. Under Advanced Settings, choose any user roles (Administrator, Editor, Shop manager and more) that should not be tracked. The tracking script is not loaded for them, and their form and WooCommerce events are not sent while they are signed in. A Purchase can still be sent when a payment gateway, automation or another staff member changes the order's status, and a tracking script added to the site by hand is not affected. ### Is PixelFlow GDPR compliant? @@ -469,6 +469,9 @@ Documentation, video tutorials and email support on all plans. Ask a question in ## Changelog +### 1.2.3 +Excluded user roles now also stop WooCommerce AddToCart, InitiateCheckout and Purchase events from their own signed-in requests, so sites that exclude roles may see lower event counts + ### 1.2.2 WooCommerce: optional setting to send Purchase only for a customer's first paid order, so subscription renewals and repeat orders stop counting as new purchases. Forms: events now include city, state, postcode and country from the visitor's location when the form has no such fields. diff --git a/app/source/src/features/settings/components/AdvancedSettings.test.tsx b/app/source/src/features/settings/components/AdvancedSettings.test.tsx index bef04ee..9fe70ae 100644 --- a/app/source/src/features/settings/components/AdvancedSettings.test.tsx +++ b/app/source/src/features/settings/components/AdvancedSettings.test.tsx @@ -177,12 +177,45 @@ describe('AdvancedSettings — excluded roles and WooCommerce event sending', () Object.keys(contextOverrides).forEach((key) => delete contextOverrides[key]); }); - it('states the limitation when WooCommerce tracking is on', () => { + it('states what the setting excludes under its new title', () => { + Object.assign(contextOverrides, { availableRoles: roles }); + render(); + + expect(screen.getByText('Exclude Tracking for User Roles')).toBeInTheDocument(); + expect( + screen.getByText( + /tracking script is not loaded for them, and their form and WooCommerce events are not sent/ + ) + ).toBeInTheDocument(); + }); + + it('states the hand-added script limit once a role is selected', () => { + Object.assign(contextOverrides, { + availableRoles: roles, + generalOptions: { ...generalOptions, excluded_user_roles: ['administrator'] }, + }); + render(); + + expect( + screen.getByText(/tracking script added to the site by hand is not affected/) + ).toBeInTheDocument(); + }); + + it('does not state the hand-added script limit with no role selected', () => { + Object.assign(contextOverrides, { availableRoles: roles }); + render(); + + expect( + screen.queryByText(/tracking script added to the site by hand is not affected/) + ).not.toBeInTheDocument(); + }); + + it('states the Purchase limit when WooCommerce tracking is on', () => { Object.assign(contextOverrides, { availableRoles: roles }); render(); expect(screen.getByTestId('excluded-roles-woo-note')).toHaveTextContent( - 'not applied to WooCommerce event sending' + "A Purchase can still be sent when a payment gateway, automation or another staff member changes the order's status" ); }); diff --git a/app/source/src/features/settings/components/AdvancedSettings.tsx b/app/source/src/features/settings/components/AdvancedSettings.tsx index 128f76e..bed9c01 100644 --- a/app/source/src/features/settings/components/AdvancedSettings.tsx +++ b/app/source/src/features/settings/components/AdvancedSettings.tsx @@ -133,11 +133,12 @@ export function AdvancedSettings() { {availableRoles.length > 0 && (

- Exclude Script for User Roles + Exclude Tracking for User Roles

- Select user roles that should NOT have the tracking script injected when they visit - the site. Useful for excluding administrators, editors, or other internal users. + Select user roles that should not be tracked while signed in. The tracking script is + not loaded for them, and their form and WooCommerce events are not sent. Useful for + excluding administrators, editors, or other internal users.

{availableRoles.map((role) => { @@ -162,14 +163,15 @@ export function AdvancedSettings() {
{excludedRoles.length > 0 && (

- Note: Users with excluded roles will not have tracking script - injected. + Note: A tracking script added to the site by hand is not affected + by this setting.

)} {isWooCommerceActive && generalOptions.woo_enabled === 1 && (

- This setting is not applied to WooCommerce event sending: add to cart, checkout - and purchase events are still sent for these roles. Form events are not. + A Purchase can still be sent when a payment gateway, automation or another staff + member changes the order's status, because that request does not belong to the + excluded user.

)}
diff --git a/docs/test-scenarios.html b/docs/test-scenarios.html index 94742f3..ca01eeb 100644 --- a/docs/test-scenarios.html +++ b/docs/test-scenarios.html @@ -3,7 +3,7 @@ -PixelFlow 1.2.2 — Test Scenario Matrix +PixelFlow 1.2.3 — Test Scenario Matrix