Skip to content

Conversation

@cramforce
Copy link
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
Member Author

CC @kashyapnitin @jasti

To @dvoytenko for review.

Copy link
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
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
Copy link
Member

@erwinmombay erwinmombay Apr 22, 2016

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
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
Member Author

PTAL

linkRel.rel = 'preload';
linkRel.setAttribute('as', 'script');
linkRel.href =
'https://cdn.ampproject.org/rtv/01$internalRuntimeVersion$/v0.js';
Copy link
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
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
Contributor

LGTM

@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