ampproject / ampproject/amphtml
Support parameters in amp-script RTC fetching
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Description
So the javascript function can get a bit of context information regarding the amp-ad. For example, a slot id.
Macro support will also help.
Not sure what the URL would look like. Perhaps:
```
rtc-config='{"urls": ["amp-script:targetingFns.getTargeting?slotid=12345&cs=CONSENT_STRING&targeting=TGT"]}'`
```
### Alternatives Considered
Can get the info via analytics.
But info for a specific amp-ad element, like slot id, will not work when working with more than one ad. At least when wanting to work with one amp-script and one analytics config.
### Additional Context
_No response_
Contributor guide
Research direction
No files or tests are named. Start by locating amp-script RTC fetching and the existing analytics alternative, then clarify the URL and macro semantics for per-ad context such as slot IDs and consent. Done means amp-script RTC requests can receive those parameters reliably when multiple ads share one amp-script configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100