-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Redirect-avoidance through AMP-side click measurement. #2969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
To @dvoytenko for review. |
ads/alp/handler.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're already guaranteed a href by the closest predicate function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Removed.
bd9128b to
7d4bdae
Compare
ads/alp/handler.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return object can also be nullable undefined with line 101
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Introduces a redirect-avoidance mechanism that enables referrers to track a link invocation without an intermediate redirect by passing a URL to AMP via a fragment param. This change is experiment guarded. Also introduces a small new binary for use on the referrer side (e.g. inside of an ad creative) that helps with constructing the respectives URLs and preconnects to AMP. Primary implementation of ampproject#2934
|
PTAL |
| linkRel.rel = 'preload'; | ||
| linkRel.setAttribute('as', 'script'); | ||
| linkRel.href = | ||
| 'https://cdn.ampproject.org/rtv/01$internalRuntimeVersion$/v0.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just always prod? or should read getMode().version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, although I did want to ping you for whether I can get the correct prefix (00, 01, etc.) at runtime in this binary. Doesn't have to be finished in this PR, though.
|
LGTM |
Introduces a redirect-avoidance mechanism that enables referrers to track a link invocation without an intermediate redirect by passing a URL to AMP via a fragment param. This change is experiment guarded.
Also introduces a small new binary for use on the referrer side (e.g. inside of an ad creative) that helps with constructing the respective URLs and preconnects to AMP.
Primary implementation of #2934