Redirect-avoidance through AMP-side click measurement. by cramforce · Pull Request #2969 · ampproject/amphtml · GitHub
Skip to content

Redirect-avoidance through AMP-side click measurement.#2969

Merged
cramforce merged 1 commit into
ampproject:masterfrom
cramforce:alp
Apr 25, 2016
Merged

Redirect-avoidance through AMP-side click measurement.#2969
cramforce merged 1 commit into
ampproject:masterfrom
cramforce:alp

Conversation

@cramforce

Copy link
Copy Markdown
Member

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

@cramforce

Copy link
Copy Markdown
Member Author

Comment thread ads/alp/handler.js Outdated

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.

We're already guaranteed a href by the closest predicate function.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. Removed.

@cramforce cramforce force-pushed the alp branch 3 times, most recently from bd9128b to 7d4bdae Compare April 22, 2016 20:01
Comment thread ads/alp/handler.js Outdated

@erwinmombay erwinmombay Apr 22, 2016

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

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
@cramforce

Copy link
Copy Markdown
Member Author

PTAL

Comment thread ads/alp/handler.js
linkRel.rel = 'preload';
linkRel.setAttribute('as', 'script');
linkRel.href =
'https://cdn.ampproject.org/rtv/01$internalRuntimeVersion$/v0.js';

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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.

@dvoytenko

Copy link
Copy Markdown
Contributor

@cramforce cramforce merged commit ee5ac61 into ampproject:master Apr 25, 2016
@cramforce cramforce deleted the alp branch April 25, 2016 22:12
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.

4 participants