ampproject / ampproject/amphtml

variable substitutions ${canonicalUrl} cutting off urls at a comma

Open
#34,498 1 comment 0 reactions 0 assignees View on GitHub
Stale Type: Bug
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

"$DEFAULT(${canonicalUrl}, notSet)" doesn't seem to report the URLs correctly in amp-analytics. It looks like for some reason the reported urls get cut of at the comma (,)

### Reproduction Steps

e.g. https://amp.tvspielfilm.de/news/tv/tatort-neugeboren-neues-bremer-team-macht-so-weiter-wie-das-alte-aufgehoert-hat,10428438,ApplicationArticle.html

look for rt.tvspielfilm.de/collect in the network console to confirm that the reported canonical url is
https://www.tvspielfilm.de/news/tv/tatort-neugeboren-neues-bremer-team-macht-so-weiter-wie-das-alte-aufgehoert-hat
rather than
https://www.tvspielfilm.de/news/tv/tatort-neugeboren-neues-bremer-team-macht-so-weiter-wie-das-alte-aufgehoert-hat,10428438,ApplicationArticle.html

### Relevant Logs

_No response_

### Browser(s) Affected

Chrome

### AMP Version Affected

2105072136000

Contributor guide

Open the contributing guide

Research direction

Start in the amp-analytics handling of the "$DEFAULT(${canonicalUrl}, notSet)" substitution and reproduce the issue with the URL in the report. Inspect the network request to rt.tvspielfilm.de/collect; done means the canonical URL remains complete, including the comma and following path text.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
analytics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.