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
Setting amp-analytics parameters with ${ampState(___)} is broken in PWA #20853
Comments
${ampState(___)}
is broken in PWA
Triaging to @zhouyx , feel free to re-assign 😄 |
Any update on this? This is affecting PWA enhanced ecommerce reporting and A/B testing reporting in Google Analytics for us. |
Thank you for filing the issue and providing the examples. Seem like runtime fails to find the ampdoc for win.document. amphtml/src/service/url-replacements-impl.js Lines 559 to 563 in 18460ff
@choumx could you please take a look. Thank you |
…t#20853) (ampproject#21283) Use ampdoc.getRootNode() to identify the relevant document/shadow node for Services.bindForDocOrNull() when making URL replacements in a PWA. Fixes ampproject#20853
…t#20853) (ampproject#21283) Use ampdoc.getRootNode() to identify the relevant document/shadow node for Services.bindForDocOrNull() when making URL replacements in a PWA. Fixes ampproject#20853
What's the issue?
When an AMP page utilizing amp-analytics is loaded in a PWA, setting an analytics parameter value via
${ampState(___)}
fails. The console reportsNo ampdoc found for [object HTMLHtmlElement]
.How do we reproduce the issue?
I have created a minimal example that demonstrates the issue. When you click the "Send Analytics" button on the AMP page,
favnum
inextraUrlParams
is set correctly (see the collect beacon in network requests). When you click the same button in the PWA,favnum
is blank and the console reportsNo ampdoc found for [object HTMLHtmlElement]
.What browsers are affected?
The following browsers have been tested and both exhibit the same behavior:
Which AMP version is affected?
1902081532110
The text was updated successfully, but these errors were encountered: