You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the UI logic for removing the marketing soft opt in for US newsletter sign-ups. When enabled for signed out US users, the marketing toggle is hidden and the user is automatically opted into similar_guardian_products.
Acceptance Criteria
Add a helper to check whether the US soft opt-in switch is enabled (via window.guardian.config.switches.us-signup-hide-marketing-toggle)
Use the useCountryCode hook to determine country
In all sign-up surfaces (SecureSignup, NewsletterSignupForm, ManyNewsletterSignUp):
If the switch is OFF, current behaviour (toggle visible for all users)
If the switch is ON and countryCode === 'US', hide the toggle and always POST marketing=true
All other countries: toggle visible as normal
No changes for signed-in users
Treat countryCode === undefined (pending) as non-US — show toggle while resolving
Add/update unit tests to cover US, non-US, and pending states
Ensure that a marketingOptInHidden field is included in the sign-up payload, alongside countryCode: 'US', when the hidden soft opt-in is applied
Analytics tracking: the marketingOptInType field sent in Ophan tracking events should reflect the soft opt-in case
When the toggle is hidden (US soft opt-in applied), send `marketingOptInType: 'similar-guardian-products-optin-hidden-us'
When the toggle is visible and the user opts in, send similar-guardian-products-optin
When the toggle is visible and the user opts out, send similar-guardian-products-optout
For signed-in users, omit marketingOptInType from the tracking payload
Applies to all three surfaces: SecureSignup, NewsletterSignupForm, ManyNewsletterSignUp
Additional Notes
The switch for this functionality is currently referred to as us-signup-hide-marketing-toggle in the codebase; ensure consistent usage across code, tests, and stories.
Overview
Implement the UI logic for removing the marketing soft opt in for US newsletter sign-ups. When enabled for signed out US users, the marketing toggle is hidden and the user is automatically opted into
similar_guardian_products.Acceptance Criteria
window.guardian.config.switches.us-signup-hide-marketing-toggle)useCountryCodehook to determine countrySecureSignup,NewsletterSignupForm,ManyNewsletterSignUp):countryCode === 'US', hide the toggle and always POSTmarketing=truecountryCode === undefined(pending) as non-US — show toggle while resolvingmarketingOptInHiddenfield is included in the sign-up payload, alongsidecountryCode: 'US', when the hidden soft opt-in is appliedmarketingOptInTypefield sent in Ophan tracking events should reflect the soft opt-in casesimilar-guardian-products-optinsimilar-guardian-products-optoutmarketingOptInTypefrom the tracking payloadSecureSignup,NewsletterSignupForm,ManyNewsletterSignUpAdditional Notes
us-signup-hide-marketing-togglein the codebase; ensure consistent usage across code, tests, and stories.