ampproject / ampproject/amphtml

Transfer data-vars-* from anchor links to their tooltip

Open
#38,219 3 comments 0 reactions 1 assignee Claimed by @gmajoulet View on GitHub
P2: Soon Stale Type: Feature Request WG: analytics WG: stories
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

It's a useful feature to be able to add data-vars- to elements (https://github.com/ampproject/amphtml/blob/main/extensions/amp-story/amp-story-analytics.md#variables-as-data-attribute) in order to send additional parameters to analytics when they are clicked. Unfortunately, it's not possible to add these to link tooltips, which are something people often want to track.

I propose copying `data-vars-` from the `` element on to the `a.i-amphtml-story-tooltip` element so that the same vars are available when clicking out to the link.

### Alternatives Considered

I don't think there are any alternatives at the moment.

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.