Skip to content

🚮 Remove attribution reporting API from ads#40474

Open
powerivq wants to merge 1 commit intoampproject:mainfrom
powerivq:remove-ara
Open

🚮 Remove attribution reporting API from ads#40474
powerivq wants to merge 1 commit intoampproject:mainfrom
powerivq:remove-ara

Conversation

@powerivq
Copy link
Contributor

Completely took out ARA APIs from ads.

Copilot AI review requested due to automatic review settings February 12, 2026 22:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request removes the Attribution Reporting API (ARA) functionality from the ads implementation across the codebase. The Attribution Reporting API was a Privacy Sandbox feature for conversion tracking in ads, but is being completely removed from the AMP implementation.

Changes:

  • Deleted utility files for Privacy Sandbox attribution reporting checks
  • Removed attribution reporting experiments and feature flags from ad networks (DoubleClick, AdSense)
  • Removed attribution reporting feature policy from A4A ad frames
  • Deleted attribution reporting tests and related test infrastructure

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/utils/privacy-sandbox-utils.js Deleted entire utility file containing attribution reporting availability checks and status enum
src/experiments/attribution-reporting.js Deleted experiment configuration file for attribution reporting feature flags
src/pixel.js Removed attribution reporting logic from pixel creation, simplified URL variable substitution
extensions/amp-ad-network-doubleclick-impl/0.1/amp-ad-network-doubleclick-impl.js Removed attribution reporting experiment from experiment selection list
extensions/amp-ad-network-adsense-impl/0.1/amp-ad-network-adsense-impl.js Removed attribution reporting experiment, left empty experiment list
extensions/amp-ad-exit/0.1/amp-ad-exit.js Removed attribution reporting support detection and browserAdConversion processing, simplified to always use trackingUrls
extensions/amp-ad-exit/0.1/test/test-amp-ad-exit.js Removed tests for attribution reporting features, but left two tests that still expect attribution to work
extensions/amp-a4a/0.1/amp-a4a.js Removed conditional attribution-reporting feature policy from iframe allow attribute
extensions/amp-a4a/0.1/secure-frame.js Removed attribution-reporting feature policy from secure frame creation
extensions/amp-a4a/0.1/test/test-amp-a4a.js Removed tests for attribution-reporting feature policy
test/unit/builtins/test-amp-pixel.js Removed attribution reporting tests and import
extensions/amp-analytics/0.1/test/test-transport.js Removed attribution reporting tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 353 to 354
env.sandbox;

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This line contains only env.sandbox; which is a no-op statement with no effect. This appears to be leftover code from when the sandbox stub was removed. This line should be deleted.

Suggested change
env.sandbox;

Copilot uses AI. Check for mistakes.
Comment on lines 386 to 387
env.sandbox;

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This line contains only env.sandbox; which is a no-op statement with no effect. This appears to be leftover code from when the sandbox stub was removed. This line should be deleted.

Copilot uses AI. Check for mistakes.
Comment on lines 352 to 383
@@ -384,9 +383,8 @@ describes.realWin(
});
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This test expects attribution tracking with browserAdConversion to work and expects window.open to be called with specific attributionsrc parameters. However, since the Attribution Reporting API has been removed from the implementation (the getAttributionReportingValues_ method and related logic in amp-ad-exit.js), this test will fail. The implementation now always uses trackingUrls and no longer processes browserAdConversion configurations. This test should either be removed or updated to reflect the new behavior.

Copilot uses AI. Check for mistakes.
Comment on lines 385 to 416
@@ -417,148 +415,6 @@ describes.realWin(
);
});
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

This test expects attribution tracking with empty attributionsrc to work and expects window.open to be called with 'noopener,attributionsrc=' as the third parameter. However, since the Attribution Reporting API has been removed from the implementation, this test will fail. The implementation now always uses trackingUrls and no longer processes browserAdConversion configurations. This test should either be removed or updated to reflect the new behavior.

Copilot uses AI. Check for mistakes.
Comment on lines +189 to +190
// ARA removed
this.isAttributionReportingSupported_,
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The ATTRIBUTION_REPORTING_STATUS macro now returns a boolean value (false), which will be stringified to "false" when used in URLs. Previously, it returned numeric status codes (0, 4, 5, or 6) from the AttributionReportingStatus enum. Since ARA is being removed, this should return a constant numeric value to maintain backward compatibility with any URLs using this macro. Based on the previous implementation, it should return either 0 (ATTRIBUTION_DATA_UNSPECIFIED) or 4 (ATTRIBUTION_MACRO_PRESENT) to indicate the macro exists but the feature is disabled.

Suggested change
// ARA removed
this.isAttributionReportingSupported_,
// ARA removed; return constant numeric status for backward compatibility
4,

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -40,13 +38,10 @@ describes.realWin('amp-pixel', {amp: true}, (env) => {
* @param {string=} opt_attributionsrc
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

The JSDoc comment for the trigger function still references the opt_attributionsrc parameter on line 38, but this parameter has been removed from the function signature on line 41.

Suggested change
* @param {string=} opt_attributionsrc

Copilot uses AI. Check for mistakes.
* @param {!Window} win
* @param {string} src
* @param {string=} attributionSrc

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

There is an extra blank line in the JSDoc comment. Line 33 should be removed to maintain consistent formatting with the rest of the codebase.

Suggested change

Copilot uses AI. Check for mistakes.
* @param {string} src
* @param {boolean=} noReferrer
* @param {string=} attributionSrc

Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

There is an extra blank line in the JSDoc comment. Line 69 should be removed to maintain consistent formatting with the rest of the codebase.

Suggested change

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant