Add Gandalf sign-in gate: daily-view triggered mandatory popup, hosting and Ophan identity - #16708
Open
juabara wants to merge 10 commits into
Open
Add Gandalf sign-in gate: daily-view triggered mandatory popup, hosting and Ophan identity#16708juabara wants to merge 10 commits into
juabara wants to merge 10 commits into
Conversation
Support the Gandalf sign-in gate journey (the Guardian-managed, Auxia-free 100% rollout): a dedicated persistent pageview counter, kept per country because campaigns differ by country group and idempotent per Ophan pageview id, that only advances once SDC confirms an active, eligible pageview via the gandalfSignInGate response marker; the counter is sent to /auxia/get-treatments so SDC can decide between the free-view marker and the non-dismissible popup treatment. Gandalf responses report to Ophan under a stable GandalfSignInGate identity with a per-country variant (gandalf-<country>) and never call Auxia for treatment interactions. Sign-in gate mount points are added to fronts, tag pages, galleries, pictures, liveblogs and full page interactives, and withSignInGateSlot now guarantees a host for bodies with fewer than two elements so the v2 popup can be selected everywhere the journey applies.
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
🚀 Image pushed to AWS ECRImage digest: 🐛 Run the image locallyThe following can be used to run the image locally: # Refer to image using the immutable digest. Find alternatives below.
IMAGE_IDENTIFIER="@sha256:68d3db61d11e4b3d93bfb64472ca62c87473afbf83cb46009eb92d2bf87a8ccc"
# Refer to image using branch tag
# IMAGE_IDENTIFIER=":branch-nz-non-auxia-sign-in-gate"
# Refer to image using build tag
# IMAGE_IDENTIFIER=":build-31130"
# Refer to image via the GitHub commit SHA tag
# IMAGE_IDENTIFIER=":sha-f3ad7606efee2b1908322cceacfcb169ea3358ff"
# Set environment variables for the AWS CLI
AWS_PROFILE="<A_PROFILE_FROM_JANUS>"
AWS_DEFAULT_REGION="eu-west-1"
IMAGE_ACCOUNT_ID=$(aws ssm get-parameter --name /organisation/accounts/artifacts --query "Parameter.Value" --output text)
REGISTRY="${IMAGE_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"
IMAGE="${REGISTRY}/guardian/dotcom-rendering${IMAGE_IDENTIFIER}"
# Login to AWS ECR https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
aws ecr get-login-password | docker login --username AWS --password-stdin $REGISTRY
# Pull the image
docker pull $IMAGE
# Run the image. You'll likely need to set additional flags. See https://docs.docker.com/reference/cli/docker/container/run.
docker run $IMAGE |
added 2 commits
September 9, 2026 14:42
Support the Gandalf sign-in gate journey (the Guardian-managed, Auxia-free 100% rollout): a dedicated persistent pageview counter, kept per country because campaigns differ by country group and idempotent per Ophan pageview id, that only advances once SDC confirms an active, eligible pageview via the gandalfSignInGate response marker; the counter is sent to /auxia/get-treatments so SDC can decide between the free-view marker and the non-dismissible popup treatment. Gandalf responses report to Ophan under a stable GandalfSignInGate identity with a per-country variant (gandalf-<country>) and never call Auxia for treatment interactions. Sign-in gate mount points are added to fronts, tag pages, galleries, pictures, liveblogs and full page interactives, and withSignInGateSlot now guarantees a host for bodies with fewer than two elements so the v2 popup can be selected everywhere the journey applies.
…m-rendering into nz-non-auxia-sign-in-gate
The v2 gate only rendered once the inline #sign-in-gate host element intersected the viewport (useIsInView). That is correct for the inline dismissible gate, but the non-dismissible popup is a modal: on long pages the host sits far below the fold, so the popup never appeared. Render it on mount and record its VIEW event immediately.
…king The mandatory popup now records its VIEW event exactly once per treatment identity (treatmentId + treatmentTrackingId) by tracking the last recorded view in a ref. Visibility changes, equivalent treatment objects supplied as new props, and StrictMode effect replays no longer duplicate the view count, Ophan event, or Auxia interaction. A new treatment identity or component remount still records a fresh view as intended.
The Gandalf sign-in gate counter is now global rather than per-country. Storage keys, function signatures, and tests updated to remove countryCode parameter. Counter still advances once per eligible pageview via idempotent pageview ID tracking.
… gate The Gandalf sign-in gate now uses gu.history.dailyArticleCount instead of a dedicated persistent counter. The daily count resets each day and is sent 0-based (current pageview excluded) to SDC. Remove gandalf.ts module, incrementGandalfPageViewCount calls, ophanPageViewId parameter from canShowSignInGatePortal, and update tests and comments to reflect the new counting mechanism.
…m-rendering into nz-non-auxia-sign-in-gate
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.
Summary
Adds the client-side half of the Gandalf sign-in gate journey: a Guardian-managed,
100% rollout sign-in gate for configured countries (decisioning stays in SDC via
gandalfSignInGateCountries, initially NZ), with no Auxia involvement.gu.history.dailyArticleCount) issent to SDC in the existing
gandalfPageViewCountfield; SDC returns themandatory popup from the 4th view of the day. The dedicated Gandalf counter
was dropped in favour of the existing daily count.
inline
#sign-in-gatehost to scroll into view (it sits below the fold onlong pages, which previously suppressed the popup entirely). Dismissible
inline gates keep the scroll-deferred behaviour.
(VIEWED/CLICKED/DISMISSED) is suppressed; responses carry the
gandalfSignInGatemarker. Non-Gandalf countries keep existing behaviour.#sign-in-gateportal hosts for fronts, tag pages, galleries,liveblogs, pictures and full-page interactives (surfaces without
ArticleRenderer), plus a short/empty-body fallback inwithSignInGateSlot.GandalfSignInGate, variantgandalf-<country>.the only exclusion applied — counting uses the daily view count as-is.
Known coverage note
gu.history.dailyArticleCountonly increments for article, liveblog, gallery,video, interactive and audio pages. Fronts, tag pages and crosswords are
display-eligible but never counted — readers who only browse those never see
the gate; readers with 3 counted views will hit the modal on a front.