Add Gandalf sign-in gate rules and Auxia bypass - #1832
Merged
Merged
Conversation
Gandalf (the marketing name for the Guardian-managed sign-in gate journey) is a 100% rollout run entirely by Guardian rules with no Auxia involvement, active for any country listed in the new gandalfSignInGateCountries channel switch (currently New Zealand; adding a country is a configuration change with no deploy). Readers in listed countries get three free eligible pageviews - tracked by a per-country client-side counter, since campaigns differ by country group - then a hardcoded non-dismissible popup treatment. Neither consent state triggers an Auxia GetTreatments or LogTreatmentInteraction call, and the RRCP banner suppression checker short-circuits for listed countries so no banner traffic reaches Auxia either. An absent or empty country list preserves current behaviour, which is the rollback path. Eligible surfaces are the Guardian metadata values Network Front, Section, Tag, Audio, Crossword, Gallery, Interactive, LiveBlog, ImageContent and Video, minus the unified legal/customer-service/Filter exclusions.
Contributor
tomrf1
reviewed
Sep 10, 2026
tomrf1
reviewed
Sep 10, 2026
added 4 commits
September 15, 2026 12:05
Remove the Gandalf country-based bypass logic that prevented Auxia consultation for readers in gandalfSignInGateCountries. The getBannerSuppressedChecker method no longer accepts countryCode parameter or checks the gandalfSignInGateCountries channel switch. Update gandalfMandatoryPopupUserTreatment to use Gandalf-specific treatment IDs ('gandalf-mandatory-popup') instead of 'default-treatment-id' to distinguish Gandalf popup events in Ophan analysis
gandalfPageViewCount duplicated dailyArticleCount, which the client already sends on every request. The free-allowance rule now reads the existing 1-based field: pageviews 1-3 are free, the fourth and later return the mandatory popup.
The Gandalf sign-in gate now triggers on the third pageview instead of the fourth. Update documentation, tests, and constant to reflect the new free allowance of two pageviews per day. Add Article to the list of eligible content types for Gandalf gate display.
…boolean switch The Gandalf sign-in gate configuration now uses a single boolean switch (`enableGandalfSignInGate`) instead of a country list (`gandalfSignInGateCountries`). When enabled, the journey applies only to New Zealand readers. Update documentation, tests, and implementation to reflect the simplified on/off toggle. Remove case-insensitive country matching logic and multi-country support.
tomrf1
reviewed
Sep 17, 2026
| // Union of the global sign-in gate exclusions, The Filter US, and the | ||
| // legal/customer-service sections excluded across the reader revenue | ||
| // channels. | ||
| const invalidSections = [ |
Member
There was a problem hiding this comment.
this can be consolidated with isValidSection
tomrf1
reviewed
Sep 17, 2026
| }; | ||
|
|
||
| export const gandalfIsValidTagIds = (tagIds: string[]): boolean => { | ||
| const invalidTagIds = ['info/newsletter-sign-up']; |
tomrf1
reviewed
Sep 17, 2026
| export const gandalfArticleIdentifierIsAllowed = (articleIdentifier: string): boolean => { | ||
| // Union of the global URL denials and the legal/customer-service page | ||
| // exclusions used by the wider reader revenue channels. | ||
| const denyPrefixes = [ |
Member
There was a problem hiding this comment.
let's update articleIdentifierIsAllowed to have the same list and reuse that instead
Remove duplicate Gandalf-specific exclusion helpers (gandalfIsValidSection, gandalfIsValidTagIds, gandalfArticleIdentifierIsAllowed) and use the shared isValidSection, isValidTagIds, and articleIdentifierIsAllowed functions instead. Add thefilter-us, privacy, complaints-and-corrections, and the-whole-picture to the global exclusion lists. Update documentation to reflect that Gandalf uses generic display exclusions rather than separate rules.
tomrf1
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Gandalf sign-in gate journey: a Guardian-managed, 100% rules-based sign-in gate for configured countries (gandalfSignInGateCountries channel switch, initially NZ), with no Auxia involvement.