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
{{ message }}
This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 7, 2025. It is now read-only.
We’d like to request a feature to be supported for FLEDGE Original Trials that allows modifying the rendering URL inside the Fenced Frame. This feature request is intended to cover the period of the Origin Trials only.
Example API: deprecatedURLToURN(originalUrn, newUrl) -> newUrn
Rationale:
Macros are a common mechanism for passing runtime data to creatives for use in rendering. An example flow is where an advertiser places text (ex: "%%HEIGHT%%") in their creative and the SSP substitutes this with relevant information (ex: the ad slot height) prior to rendering the creative. Google's ads products support various macros, with one set of examples found at https://support.google.com/admanager/answer/2376981 – usages include size, ad unit, URL, GDPR, and more. There are also commonly-used macros established by industry frameworks, such as ${GDPR}, ${GDPR_CONSENT_XXXXX}, and ${US_PRIVACY}.
Macro substitution fundamentally breaks with FLEDGE – the allowed creative mutations are very limited and fenced frame rendering means that creatives render without access to the publisher’s page or information.
The navigator.deprecatedURNToURL API supported by the FLEDGE OT spec allows the retrieval of the underlying URL for the winning FLEDGE creative, which would allow applying macro substitutions to the creative URL. With the current spec, however, this modified URL could only be rendered in an IFrame and not a Fenced Frame.
We propose that the browser support a debug API that allows loading the modified rendering URL inside the Fenced Frame (and in particular invoking the same reporting API as if deprecatedURNToURL had never been called). This would be a mechanism to continue to support macro substitution during the Origin Trials, while the ads industry adjusts to a new world where macro substitution is no longer possible.
With the current spec, however, this modified URL could only be rendered in an IFrame and not a Fenced Frame.
Can you point me to where this is written? We need to update that. You can actually load a plaintext url in a Fenced Frame, and put it in opaque-ads mode. Which is what I recommend that you do. e.g., first call deprecatedURNToURL to get the plaintext URL, modify it as needed, and then load it in <fencedframe mode="opaque-ads" src=your_macro_substituted_url>.
@jkarlin Sorry, you're right that "this modified URL could only be rendered in an IFrame and not a Fenced Frame" is incorrect. The motivation for this proposal, though, is the "invoking the same reporting API as if deprecatedURNToURL had never been called" bit.
This seems like a reasonable need as it enables experimentation with Fenced Frames and the reporting APIs therein as @jeffkaufman's comment mentions. This seems like something that’s permissible during the OT phase while converting URNs to URLs is already facilitated by the navigator.deprecatedURNToURL() API. Two questions:
Allowing replacement of the entire URL seems overly powerful; a bidder might be unpleasantly surprised if a seller replaced their winning ad creative URL with that of another ad creative URL. What if we limited this to only macro substitutions and only when the pattern to replace either started with “${“ and ended with “}” (and didn’t contain other “{“ or “}” instances), or started and ended with “%%” (and didn’t contain other “%%” instances)? For example the API might look like: navigator.deprecatedReplaceInURN(urn, {'${X}': '1', '%%Y%%': '2'})
How do you expect this to work with component ads? Perhaps it could perform the macro substitution on the component ad URLs also?
An API as you describe that formally supports macro substitution should work for this feature request. Also supporting these substitutions for component ads would be important as well.
Do you need the API to support replacing "${"/"}" delimited sequences within URL paths (not query or fragment strings)? Supporting that case is more complicated due to how URL parsing works -- the URL parsing spec (https://url.spec.whatwg.org/#url-parsing) specifies that the '{' and '}' characters will be percent encoded inside paths but not inside query or fragment strings.
The spec for the ${GDPR_CONSENT_XXXXX} and similar macros indicates that they are used as URL parameters, though it's possible they are being used in other parts of the URL.
Note also that macro text isn't necessarily static and can include dynamic information -- the actual replacement logic that would be most useful would be closer to a regex. E.g., something that can handle &gdpr_consent=${GDPR_CONSENT_123}, &gdpr_consent=${GDPR_CONSENT_777}, etc.
Just so you all know, as of M112 deprecatedReplaceInURN and deprecatedURNToURL also work with fenced frame configs. (The method name is the same; you pass a config in the same slot instead of a urn.)
I’d like to follow up on @timphsieh's comment and ask if the Chrome team would be able to support deprecatedReplaceInURN until Fenced Frame enforcement in 2026.
Rationale
We believe that supporting macro substitution at 3PCD and through 2026 will help the industry better navigate the transition period, given there are a number of key advertising use cases that rely on macro substitution today, without materially impacting the privacy model.
Use cases for macro substitution
As @av-sherman noted, macro substitution is a common mechanism for passing data to creatives for use in rendering.
Perhaps the most significant use case is regulatory consent requirements, where macro substitution is commonly used within industry frameworks to pass user consent information to ad tech vendors (e.g. the ${GDPR_CONSENT_XXXXX} macro). Transitioning the entire industry to a different framework will take time, which may jeopardize ecosystem readiness for cookie deprecation.
There are other important use cases for macro substitution too - for example buyers may use information retrieved through macro substitution (such as ad size, or even contextual information) to optimize creative asset selection at render time. While there are alternative approaches that may enable this use case, it’d require that both sellers and buyers transition away from the existing, commonly used, and well optimized approach and it’s unclear what benefit that would bring (see below).
Why we believe 2026 should be okay
We appreciate that one of the privacy goals of the Protected Audience API and the requirement that ads render in a Fenced Frame is to prevent communication between the page and the creative. However, given that Fenced Frames will not be required until 2026, it will be the case that communication between the page and the creative is possible - for example via a postMessage() into an iFrame.
Therefore, it seems consistent to also allow for macro substitution via deprecatedReplaceInURN until Fenced Frame rendering is required.
In May 2022 Chrome added support for deprecatedReplaceInURN to address a number of different transitional issues that arose as Protected Audiences was adopted. The original ask is detailed in this issue. Macro replacement in ad creative URLs was a practice that predates Protect Audiences. The ask for this API was originally only for the duration of the Protected Audience origin trial.
The API was also later found to help ease the transition to Protected Audience in other ways. For example, as adtechs work to adopt passing ad width and height into Protected Audience using the new ad sizes API, deprecatedReplaceInURN allowed prototyping this macro replacement before the new API was adopted, which helped avoid an extra network roundtrip.
We’ve been thinking more about when to deprecate this feature as it facilitates user identity flowing into the ad rendering frame, which is something that Fenced Frames seeks to avoid. However it turns out that deprecatedReplaceInURN aides in Fenced Frame adoption because it can facilitate some legacy instances where it’s useful to pass contextual information into the ad rendering frame. Without these legacy instances addressed by deprecatedReplaceInURN, adtech might prefer to render ads in iframes (thus delaying Fenced Frame adoption) and pass this information in via postMessage, which Fenced Frames don’t allow. So, while iframe rendering is allowed until 2026, it makes sense to allow deprecatedReplaceInURN to be used.
For the reasons above, we will continue to support deprecatedReplaceInURN until at least 2026.
Reacted by rdgordon-index, Pieter Mees, Patrick McCann and xpfgg
Is there any intention to document this deprecatedXXX hole in the privacy story? These APIs aren't in the specification and it was not exactly obvious that the opaque URN was not effectively hiding anything from sites, given that an API to reverse the mapping exists (and will do for at least two more years).
I saw that the Protected Audience spec for deprecatedRenderURLReplacements seems to have a different spec than your above comment. More specifically, the example in the spec shows a potentially incorrect dictionary?:
However, your above comment mentioned that deprecatedRenderURLReplacements should be a dictionary.
Separately, I wasn't able to use deprecatedRenderURLReplacements to replace any macro in M125 when I passed deprecatedRenderURLReplacements to the top level auctionConfig. (I haven't tested component's auctionConfig yet.
To answer my own question, it looks like the Chrome feature flag --enable-features=FledgeDeprecatedRenderURLReplacements needs to be enabled to get this to work.
In addition, it looks like deprecatedRenderURLReplacements works for a dictionary (similar to deprecatedReplaceInURN()). The spec's example is likely a typo.
Hi,
we advice our partners to use the next renderUrl format - https://${seller_url}/%%seller_param%%pr1=val1...
we found that this format is the best for replacing origin(host) and path(+query params as an option).
can you confirm that the next format will work during support for deprecatedReplacedInURN?
@michaelkleber and @JensenPaul, I confirmed that the above would work in M126. Can you help confirm that the above URL format could continue to work?
@timphsieh-google, the macro replacement code hasn't been modified since it landed 9 months ago, and I don't know of any plans to modify it. So long as the URL is valid before and after replacements, I don't see a reason it would not continue to work.
after IG creation Chrome adds an additional / before the question mark.
@fhoering, I believe this is a byproduct of standard URL parsing. When I put new URL("https://a?").toString() in the JavaScript console of all the browsers I tried, I get "https://a/?".
@michaelkleber and @JensenPaul
Can you confirm that this will not create issues somewhere in Chrome for caching or page loading ?
@fhoering, caching and page loading are done with URLs after the macro replacements are completed, so they should be unaffected by the URL's state prior to macro replacement.
A quick update on the status of rolling out of deprecatedRenderURLReplacements: This support is enabled in 50% of Chrome Canary and Dev and Beta traffic, and 1% of Chrome Stable traffic. We hope to very soon have it enabled for 100% of Chrome traffic. Note that we’re not rolling out to labeled Chrome-facilitated testing traffic to avoid disrupting ongoing experiments and testing.
Reacted by rdgordon-index, Omri Ariav and David Dabbs
@JensenPaul Hi, what's the latest on the rollout? I tried searching for the feature status at https://chromestatus.com/features but couldn't find it. Do you have a plan to add this to a stable release?
Note that we’re not rolling out (deprecatedRenderURLReplacements) to labeled Chrome-facilitated testing traffic to avoid disrupting ongoing experiments and testing.
As I understand it, the CMA-aligned "market testing" has completed. Chrome has extended the current set of labels (evaluating possible changes to the labeling configuration), and you "expect ad-techs to continue to use the labels to evaluate and optimize deployments of the Privacy Sandbox Ads APIs." Evaluating features across all users would be helpful.
Activity
jkarlin commentedon Apr 21, 2022
Hi there, thanks for filing the report!
Can you point me to where this is written? We need to update that. You can actually load a plaintext url in a Fenced Frame, and put it in opaque-ads mode. Which is what I recommend that you do. e.g., first call
deprecatedURNToURLto get the plaintext URL, modify it as needed, and then load it in<fencedframe mode="opaque-ads" src=your_macro_substituted_url>.jeffkaufman commentedon Apr 24, 2022
@jkarlin Sorry, you're right that "this modified URL could only be rendered in an IFrame and not a Fenced Frame" is incorrect. The motivation for this proposal, though, is the "invoking the same reporting API as if deprecatedURNToURL had never been called" bit.
Specifically, rendering a plaintext url in a fencedframe won't allow the APIs in https://github.com/WICG/turtledove/blob/main/Fenced_Frames_Ads_Reporting.md (ex:
window.fence.reportEvent), to work, because the browser will not know which FLEDGE auction they refer to.jkarlin commentedon Apr 25, 2022
Ah, I see. You lose the metadata associated with the oapque url when translating. Thanks for the clarification.
JensenPaul commentedon Apr 25, 2022
This seems like a reasonable need as it enables experimentation with Fenced Frames and the reporting APIs therein as @jeffkaufman's comment mentions. This seems like something that’s permissible during the OT phase while converting URNs to URLs is already facilitated by the
navigator.deprecatedURNToURL()API. Two questions:Allowing replacement of the entire URL seems overly powerful; a bidder might be unpleasantly surprised if a seller replaced their winning ad creative URL with that of another ad creative URL. What if we limited this to only macro substitutions and only when the pattern to replace either started with “${“ and ended with “}” (and didn’t contain other “{“ or “}” instances), or started and ended with “%%” (and didn’t contain other “%%” instances)? For example the API might look like:
navigator.deprecatedReplaceInURN(urn, {'${X}': '1', '%%Y%%': '2'})How do you expect this to work with component ads? Perhaps it could perform the macro substitution on the component ad URLs also?
av-sherman commentedon Apr 26, 2022
An API as you describe that formally supports macro substitution should work for this feature request. Also supporting these substitutions for component ads would be important as well.
Thanks.
brusshamilton commentedon May 10, 2022
Do you need the API to support replacing "${"/"}" delimited sequences within URL paths (not query or fragment strings)? Supporting that case is more complicated due to how URL parsing works -- the URL parsing spec (https://url.spec.whatwg.org/#url-parsing) specifies that the '{' and '}' characters will be percent encoded inside paths but not inside query or fragment strings.
av-sherman commentedon May 10, 2022
The spec for the ${GDPR_CONSENT_XXXXX} and similar macros indicates that they are used as URL parameters, though it's possible they are being used in other parts of the URL.
Note also that macro text isn't necessarily static and can include dynamic information -- the actual replacement logic that would be most useful would be closer to a regex. E.g., something that can handle
&gdpr_consent=${GDPR_CONSENT_123},&gdpr_consent=${GDPR_CONSENT_777}, etc.brusshamilton commentedon May 17, 2022
navigator.deprecatedReplaceInURNhas now been implemented in Chrome 103.jeffkaufman commentedon May 17, 2022
Demo pages showing that it works: first https://www.trycontra.com/test/td/join-replace.html and then https://www.jefftk.com/test/td/auction-replace.html
gtanzer commentedon Apr 20, 2023
Just so you all know, as of M112
deprecatedReplaceInURNanddeprecatedURNToURLalso work with fenced frame configs. (The method name is the same; you pass a config in the same slot instead of a urn.)timphsieh-google commentedon May 12, 2023
Do you know how long will deprecatedReplaceInURN() be supported?
rahulkooverjee-google commentedon Aug 10, 2023
I’d like to follow up on @timphsieh's comment and ask if the Chrome team would be able to support deprecatedReplaceInURN until Fenced Frame enforcement in 2026.
Rationale
We believe that supporting macro substitution at 3PCD and through 2026 will help the industry better navigate the transition period, given there are a number of key advertising use cases that rely on macro substitution today, without materially impacting the privacy model.
Use cases for macro substitution
As @av-sherman noted, macro substitution is a common mechanism for passing data to creatives for use in rendering.
Perhaps the most significant use case is regulatory consent requirements, where macro substitution is commonly used within industry frameworks to pass user consent information to ad tech vendors (e.g. the ${GDPR_CONSENT_XXXXX} macro). Transitioning the entire industry to a different framework will take time, which may jeopardize ecosystem readiness for cookie deprecation.
There are other important use cases for macro substitution too - for example buyers may use information retrieved through macro substitution (such as ad size, or even contextual information) to optimize creative asset selection at render time. While there are alternative approaches that may enable this use case, it’d require that both sellers and buyers transition away from the existing, commonly used, and well optimized approach and it’s unclear what benefit that would bring (see below).
Why we believe 2026 should be okay
We appreciate that one of the privacy goals of the Protected Audience API and the requirement that ads render in a Fenced Frame is to prevent communication between the page and the creative. However, given that Fenced Frames will not be required until 2026, it will be the case that communication between the page and the creative is possible - for example via a postMessage() into an iFrame.
Therefore, it seems consistent to also allow for macro substitution via deprecatedReplaceInURN until Fenced Frame rendering is required.
JensenPaul commentedon Aug 17, 2023
In May 2022 Chrome added support for
deprecatedReplaceInURNto address a number of different transitional issues that arose as Protected Audiences was adopted. The original ask is detailed in this issue. Macro replacement in ad creative URLs was a practice that predates Protect Audiences. The ask for this API was originally only for the duration of the Protected Audience origin trial.The API was also later found to help ease the transition to Protected Audience in other ways. For example, as adtechs work to adopt passing ad width and height into Protected Audience using the new ad sizes API,
deprecatedReplaceInURNallowed prototyping this macro replacement before the new API was adopted, which helped avoid an extra network roundtrip.We’ve been thinking more about when to deprecate this feature as it facilitates user identity flowing into the ad rendering frame, which is something that Fenced Frames seeks to avoid. However it turns out that
deprecatedReplaceInURNaides in Fenced Frame adoption because it can facilitate some legacy instances where it’s useful to pass contextual information into the ad rendering frame. Without these legacy instances addressed bydeprecatedReplaceInURN, adtech might prefer to render ads in iframes (thus delaying Fenced Frame adoption) and pass this information in viapostMessage, which Fenced Frames don’t allow. So, while iframe rendering is allowed until 2026, it makes sense to allowdeprecatedReplaceInURNto be used.For the reasons above, we will continue to support
deprecatedReplaceInURNuntil at least 2026.martinthomson commentedon Oct 30, 2023
Is there any intention to document this
deprecatedXXXhole in the privacy story? These APIs aren't in the specification and it was not exactly obvious that the opaque URN was not effectively hiding anything from sites, given that an API to reverse the mapping exists (and will do for at least two more years).16 remaining items
michaelkleber commentedon Mar 25, 2024
Yes!
timphsieh-google commentedon Apr 3, 2024
@michaelkleber
I saw that the Protected Audience spec for
deprecatedRenderURLReplacementsseems to have a different spec than your above comment. More specifically, the example in the spec shows a potentially incorrect dictionary?:However, your above comment mentioned that
deprecatedRenderURLReplacementsshould be a dictionary.Separately, I wasn't able to use
deprecatedRenderURLReplacementsto replace any macro in M125 when I passeddeprecatedRenderURLReplacementsto the top levelauctionConfig. (I haven't tested component'sauctionConfigyet.timphsieh-google commentedon Apr 3, 2024
To answer my own question, it looks like the Chrome feature flag
--enable-features=FledgeDeprecatedRenderURLReplacementsneeds to be enabled to get this to work.In addition, it looks like
deprecatedRenderURLReplacementsworks for a dictionary (similar todeprecatedReplaceInURN()). The spec's example is likely a typo.Web platform tests for deprecatedRenderURLReplacements.
yonf-fel commentedon May 6, 2024
Hi,
we advice our partners to use the next renderUrl format - https://${seller_url}/%%seller_param%%pr1=val1...
we found that this format is the best for replacing origin(host) and path(+query params as an option).
can you confirm that the next format will work during support for deprecatedReplacedInURN?
omriariav commentedon May 15, 2024
@timphsieh-google can you please review @yonf-fel last question, please?
timphsieh-google commentedon May 16, 2024
Yes. I also verified that the above suggestion could certainly work. However, I think there could be a sligtly better format:
This way we can use the same style of macros.
@michaelkleber and @JensenPaul, I confirmed that the above would work in M126. Can you help confirm that the above URL format could continue to work?
fhoering commentedon May 16, 2024
The latest proposal seems fine to me. The only downside is that after IG creation Chrome adds an additional
/before the question mark.After calling
navigator.joinAdInterestGroupbecomes
@michaelkleber and @JensenPaul
Can you confirm that this will not create issues somewhere in Chrome for caching or page loading ?
JensenPaul commentedon May 17, 2024
@timphsieh-google, the macro replacement code hasn't been modified since it landed 9 months ago, and I don't know of any plans to modify it. So long as the URL is valid before and after replacements, I don't see a reason it would not continue to work.
@fhoering, I believe this is a byproduct of standard URL parsing. When I put
new URL("https://a?").toString()in the JavaScript console of all the browsers I tried, I get"https://a/?".@fhoering, caching and page loading are done with URLs after the macro replacements are completed, so they should be unaffected by the URL's state prior to macro replacement.
JensenPaul commentedon May 20, 2024
A quick update on the status of rolling out of
deprecatedRenderURLReplacements: This support is enabled in 50% of Chrome Canary and Dev and Beta traffic, and 1% of Chrome Stable traffic. We hope to very soon have it enabled for 100% of Chrome traffic. Note that we’re not rolling out to labeled Chrome-facilitated testing traffic to avoid disrupting ongoing experiments and testing.omriariav commentedon Jul 8, 2024
@JensenPaul Hi, what's the latest on the rollout? I tried searching for the feature status at https://chromestatus.com/features but couldn't find it. Do you have a plan to add this to a stable release?
omriariav commentedon Aug 1, 2024
@JensenPaul hi, following up here if you can please help me gather more visibility on when it will reach stable?
dmdabbs commentedon Aug 14, 2024
Hello @JensenPaul. Back in May you wrote:
As I understand it, the CMA-aligned "market testing" has completed. Chrome has extended the current set of labels (evaluating possible changes to the labeling configuration), and you "expect ad-techs to continue to use the labels to evaluate and optimize deployments of the Privacy Sandbox Ads APIs." Evaluating features across all users would be helpful.
dmdabbs commentedon Sep 5, 2024
Hello @JensenPaul. The
FledgeDeprecatedRenderURLReplacementscmdline flag no longer works in Canary. I've had this flag set for quite some time.Noting also that back in May you "hope to very soon have it enabled for 100% of Chrome traffic."
JensenPaul commentedon Oct 16, 2024
This went to 100% of Chrome Stable population May 20th.
The flag was enabled by default in Canary May 17th in this CL.