amphtml
amphtml copied to clipboard
amp-analytics uach brands is stringified to object Object
Description
using ${uach(brands)} results in "[object Object],[object Object],[object Object]"
instead of an array of the brands, for example in my case:
brands: Array(3)
0: {brand: 'Google Chrome', version: '95'}
1: {brand: 'Chromium', version: '95'}
2: {brand: ';Not A Brand', version: '99'}
Reproduction Steps
- create an analytics.json config with
"transport": {
"useBody": true,
- in
extraUrlParamssection use
"extraUrlParams": {
"brands": "${uach(brands)}",
Relevant Logs
No response
Browser(s) Affected
No response
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
No response
Opened a PR for a fix by JSON.stringifying non-primitive UACH values.
Can you take a look and see if this matches your expectation?
Resolved with #36648.