ampproject / ampproject/amphtml

Event trigger to only fire once per document load

Open
#39,497 1 comment 0 reactions 1 assignee Claimed by @erwinmombay View on GitHub
P2: Soon Stale Type: Feature Request WG: analytics WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

My end goal is to be able to fire an "interaction" event to a reporting endpoint.
I need this to fire only once per document load (first interaction), as it makes it easier to calculate an interaction rate (interactions / views).

Either a new "interaction" trigger that only fired once, or a "click" trigger with the ability to only fire once, would enable my use-case.

### Alternatives Considered

I tried using "on": "click" but cannot since it fires on every click, not only the first one.
I have not found any other ways it could be achieved.

### 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.