ampproject / ampproject/amphtml
vars as data attribute does not work on amp-story-page element
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Description
I'm trying to send analytics to GA. I've created a `var as data attribute` like is and place it on `amp-story-page` like it's written here: https://github.com/ampproject/amphtml/blob/main/extensions/amp-analytics/analytics-vars.md#variables-as-data-attribute.
but it doesn't seem to work.
All the other parameters are working.


### Reproduction Steps
1. create `amp-story-page`
2. add a data attribute
3. try to send it to google analytics
### Relevant Logs
_No response_
### Browser(s) Affected
Chrome
### OS(s) Affected
_No response_
### Device(s) Affected
_No response_
### AMP Version Affected
_No response_
Contributor guide
Research direction
Start with extensions/amp-analytics/analytics-vars.md and the amp-story-page reproduction described in the issue. Trace how amp-analytics reads data attributes on story pages, then reproduce the Google Analytics request in Chrome. Done means the documented attribute is recognized on amp-story-page and its value reaches the analytics request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- analytics, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100