Skip to content

Add mParticle consent sync configuration and API URL#28691

Open
andresilva-guardian wants to merge 1 commit intomainfrom
afs/mparticle-consent-sync
Open

Add mParticle consent sync configuration and API URL#28691
andresilva-guardian wants to merge 1 commit intomainfrom
afs/mparticle-consent-sync

Conversation

@andresilva-guardian
Copy link
Copy Markdown
Contributor

@andresilva-guardian andresilva-guardian commented Mar 30, 2026

What is the value of this and can you measure success?

This prepares the frontend to support a new mParticle consent sync feature in dotcom-rendering. Without these changes, DCR has no way to know whether the feature is enabled or which API endpoint to call. Success is measured by dotcom-rendering being able to read window.guardian.config.switches.mparticle-consent-sync and window.guardian.config.page.mparticleApiUrl correctly once the switch is turned on.

What does this change?

Two small additions, both inert until the switch is explicitly enabled:

  1. New feature switch mparticle-consent-sync (PrivacySwitches.scala)
    Added to the Privacy switch group with safeState = Off and exposeClientSide = true. This serialises into window.guardian.config.switches in the page HTML. The switch defaults to OFF and is not enabled in any environment by this PR.

  2. New page config value mparticleApiUrl (configuration.scala, JavaScriptPage.scala)
    Added an object mparticle to Configuration that reads mparticle.api.url from the parameter store as an Option[String]. The value is conditionally emitted into window.guardian.config.page only when configured:

    • PROD: https://mparticle-api.support.guardianapis.com
    • CODE / DEVINFRA: https://mparticle-api-code.support.guardianapis.com

No existing behaviour is changed.

Screenshots

N/A — no UI changes.

Checklist

@andresilva-guardian andresilva-guardian requested a review from a team as a code owner March 30, 2026 10:51
@andresilva-guardian andresilva-guardian added the feature Departmental tracking: work on a new feature label Mar 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

SwitchGroup.Privacy,
"mparticle-consent-sync",
"Enables syncing of browser consent state to mParticle for paid media targeting",
owners = group(Commercial),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how ownership is defined, but Commercial doesn't seem like the right value here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Departmental tracking: work on a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants