Skip to content
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

📖 [amp-analytics] Document async var resolutions (in relation to CWV) #32394

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

micajuine-ho
Copy link
Contributor

Closes #30940

Document that variables are fulfilled async--which could affect collection of CWV.

@@ -476,6 +476,13 @@ In addition, all of the variables supported by
[AMP HTML Substitutions Guide](../../spec/amp-var-substitutions.md)
are also supported.

Variables are resolved asynchronously and can delay the request until they are
Copy link
Contributor

Choose a reason for hiding this comment

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

are or can?

I'd assume some are resolved synchronously or close enough to sync to not be a factor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, some async ones may resolve quickly.

Largest Contentful Paint are calculated after the page is hidden. For First
Input Delay, it is resolved after the user interacts with the page. For this
reason these metrics might not be suitable for use with all triggers (for
example, on timer or visible).
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good: QQ though, did we add a specific trigger for when all these values have been captured?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No specific trigger, however using something like page view would allow the trigger to be fired immediately, and only wait for the CWV macros to resolve, before sending.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve amp-analytics documentation for async macros & Core Web Vitals
3 participants