ampproject / ampproject/amphtml

Support parameters in amp-script RTC fetching

Open
#35,097 2 comments 0 reactions 0 assignees View on GitHub
Stale Type: Feature Request
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.